I need some help with this one!
I'm creating TIFF images on the fly, but I need to stack them in a file with offsets in an XML File.
For example 3 tiff images in one file
The first one starts at offset 0 and for size of 3211
The Second one starts at 3211 and for size of 1547
The Thrid one starts at 4758 and for size of 1465
I hope you get the idea...I need to stack them up so another application can read the offet and size to pull the image out from the one file.
How can I accomplish this?
Here is my code that generates the images, but as I create them how can I merge them into one file?
Dim ImgOffset As Int32 = 0
Dim ImgLength As Int32 = 0
Dim ImgResolution As Int32 = 200
Dim ImgHeight As Int32 = 574
Dim ImgWidth As Int32 = 1312
Dim ImageWriter As IO.FileStream = New IO.FileStream("C:\TestImage.tif", FileMode.Create)
Dim memstrm As IO.MemoryStream = New IO.MemoryStream
Dim ticket As New Bitmap(ImgWidth, ImgHeight)
Dim TicketID_Font As New Font("Arial", 20, FontStyle.Regular)
Dim ticketGraphics As Graphics = Graphics.FromImage(ticket)
ticketGraphics.FillRectangle(Brushes.White, 0, 0, ImgWidth, ImgHeight)
ticketGraphics.DrawString("-- My Ticket --", TicketID_Font, Brushes.Black, 520, 90)
ticketGraphics.DrawString("Ticket ID: 800001", TicketID_Font, Brushes.Black, 10, 160)
ticketGraphics.DrawString("Ticket Amount: 111", TicketID_Font, Brushes.Black, 10, 200)
ticketGraphics.DrawString("Date: " & Now().ToShortDateString, BatchID_Font, Brushes.Black, 10, 240)
ImgLength = memstrm.Length
In the above example I can get the Image Length to put into my XML file, where I'm getting stuck is how can I add my next image to my File Stream (ImageWriter)?
I've done append on the File Stream...but the receiving application doesn't like that so it may need to be something like multi-page to merge them together.
Can someone provide me with an example of taking my code and creating a merged file?