|
-
May 28th, 2002, 06:15 PM
#1
Thread Starter
Lively Member
Reordering Arrays..Bitmap Data?
Here's the deal...
I read in a .bmp file and parse the headers. I find the height, width, and bitcount not to mention where the header ends. Afterwards, I load the bitmap image data into a byte array. Now all I need to do is to flip the array so that the image data is in proper order. OK...here goes....
First I did this....
Open CurrFile For Binary As ff
Get ff, HeaderSize + 1, CharInput
Close #ff
z = 0
For a = UBound(CharInput) To 0 Step -1
PicArray(z) = CharInput(a)
z = z + 1
Next
This successfully flips the image data vertically but not horizontally. I did many more complicated routines and have been able to flip it properly, but here is my REAL PROBLEM....
Using the code above 2 out of three images come out flawlessly(minus the required horizontal flip). The third image still needs the horizontal flip but is askew as well. It is actually diagonal.
I preview the images with this code....
z = 0
For a = 0 To bHeight - 1
For b = 0 To bWidth - 1
.picPreview.PSet (b, a), RGB(PicArray(z), PicArray(z + 1), PicArray(z + 2))
z = z + bBitCount
Next
Next
The 2 successful image stats:
Image 1 : 100x100@24bit
Image 2 : 512x256@24bit
The problem image stats:
Image 3 : 819x529@24bit
I'm confused. Need more info or can help let me know..
C
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|