Tyler Member Licensed User Longtime User Apr 27, 2016 #1 Would it be possible to append the resulting Bytes from a camera image to an existing .JPG file and have the pics both show, linked either vertically or horizontally but in a single .JPG if that makes any sense. Might be a dumb question but thanks for any insight!
Would it be possible to append the resulting Bytes from a camera image to an existing .JPG file and have the pics both show, linked either vertically or horizontally but in a single .JPG if that makes any sense. Might be a dumb question but thanks for any insight!
JordiCP Expert Licensed User Longtime User Apr 28, 2016 #2 I would use a canvas and draw both pictures in it, arranged as you want (horizontally or vertically) Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Apr 28, 2016 #3 Appending the bytes to an existing files will not work. It will just create a corrupted image. As @JordiCP wrote you should use Canvas to draw the bitmaps and then save the Canvas bitmap. Upvote 0
Appending the bytes to an existing files will not work. It will just create a corrupted image. As @JordiCP wrote you should use Canvas to draw the bitmaps and then save the Canvas bitmap.
Tyler Member Licensed User Longtime User Apr 30, 2016 #4 So, same concept but using canvas? Something to the affect of Code: Copy Canvas1.Bitmap.WriteToStream(Image A params) Canvas1.Bitmap.WriteToStream(Image B params) Would work? Thanks again for the replies Upvote 0
So, same concept but using canvas? Something to the affect of Code: Copy Canvas1.Bitmap.WriteToStream(Image A params) Canvas1.Bitmap.WriteToStream(Image B params) Would work? Thanks again for the replies
KMatle Expert Licensed User Longtime User Apr 30, 2016 #5 The trick is to "paint" both pictures on one canvas and the store the canvas as one new picture containing both. A JPG is a structured data object. You cant just append some bytes to an existing. Merging two jpg's bytewise will need a deep knowlege of the jpeg format: https://en.wikipedia.org/wiki/JPEG Upvote 0
The trick is to "paint" both pictures on one canvas and the store the canvas as one new picture containing both. A JPG is a structured data object. You cant just append some bytes to an existing. Merging two jpg's bytewise will need a deep knowlege of the jpeg format: https://en.wikipedia.org/wiki/JPEG