Re: Image <-> Byte Array
- From: "Jim Mack" <jmack@xxxxxxxxxxxxxxx>
- Date: Fri, 8 Dec 2006 07:12:06 -0500
Ivan Debono wrote:
Hi all,
I have the following 2 functions:
1. ConvertToPicture: converts a byte array to a picture
2. ConvertToByteArray: converts a picture to a byte array
In ConvertToByteArray, there are a few lines of test code (commented):
When I save the original oImage to a file, it's about 3.5MB and is a
valid bmp. But when I convert the byte array back to an image, the
temporary 'pic.tmp' file is 11.5MB and is not a valid bmp.
Since that's about 3x too large, I'm suspicious of this line:
ReDim PicBits(1 To BytesPerLine * PicInfo.bmHeight * 3) As Byte
What is the "* 3" doing here that hasn't already been done when you compute BytesPerLine?
--
Jim Mack
MicroDexterity Inc
www.microdexterity.com
.
- Follow-Ups:
- Re: Image <-> Byte Array
- From: Rick Rothstein \(MVP - VB\)
- Re: Image <-> Byte Array
- From: Ivan Debono
- Re: Image <-> Byte Array
- References:
- Image <-> Byte Array
- From: Ivan Debono
- Image <-> Byte Array
- Prev by Date: Image <-> Byte Array
- Next by Date: Re: Image <-> Byte Array
- Previous by thread: Image <-> Byte Array
- Next by thread: Re: Image <-> Byte Array
- Index(es):
Loading