C
Charles A. Lackman
Hello,
I have created a print document that consits of many pictures. I have been
able to print it out and produce a print preview. What I need to accomplish
now is the ability to write the PrintDocument to a file on the hard drive as
a bmp.
I am assuming that I need to use the BinaryWriter but I am a bit confused as
how to use it properly. First I have been unable to write the PrintDocument
into a BinaryStream.
Using a normal file that is already on my hard drive (a test):
Dim ReadStream As System.IO.Stream = System.IO.File.Open("C:\Chuck.jpg",
System.IO.FileMode.Open, System.IO.FileAccess.Read)
Dim ReadWriter As New System.IO.BinaryReader(ReadStream)
ReadStream.Close()
ReadWriter.Close()
Dim WriteStream As System.IO.Stream =
System.IO.File.OpenWrite("C:\ChuckTest.jpg")
Dim WriteWriter As New System.IO.BinaryWriter(WriteStream)
WriteStream.Close()
WriteWriter.Close()
If this is right, how do I link the two steams together?? and how do I turn
the PrintDocument or Image into a stream?
Any help will be greatly appreciated,
Thanks,
Chuck
I have created a print document that consits of many pictures. I have been
able to print it out and produce a print preview. What I need to accomplish
now is the ability to write the PrintDocument to a file on the hard drive as
a bmp.
I am assuming that I need to use the BinaryWriter but I am a bit confused as
how to use it properly. First I have been unable to write the PrintDocument
into a BinaryStream.
Using a normal file that is already on my hard drive (a test):
Dim ReadStream As System.IO.Stream = System.IO.File.Open("C:\Chuck.jpg",
System.IO.FileMode.Open, System.IO.FileAccess.Read)
Dim ReadWriter As New System.IO.BinaryReader(ReadStream)
ReadStream.Close()
ReadWriter.Close()
Dim WriteStream As System.IO.Stream =
System.IO.File.OpenWrite("C:\ChuckTest.jpg")
Dim WriteWriter As New System.IO.BinaryWriter(WriteStream)
WriteStream.Close()
WriteWriter.Close()
If this is right, how do I link the two steams together?? and how do I turn
the PrintDocument or Image into a stream?
Any help will be greatly appreciated,
Thanks,
Chuck