Writing to a file

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top