BMP file for Ray's DVI demos
Don M
Posts: 1,652
I was playing with Ray's DVI shield graphics demo. He has 4 sample graphics 640x480. I took a picture I had that was a jpg and saved it as a bmp file 640x480 in size and substituted it for one of the other samples in his demo program but it does not show. Is there something else that needs to be converted in order to work? The file size is approximately the same as his samples.
If there is something that needs to be changed what program do I use to change it?
Thanks.
If there is something that needs to be changed what program do I use to change it?
Thanks.
Comments
Besides that, I think the code can handle most formats.
24-bit Windows bitmaps should work...
Somebody noticed though that the code is hardwired for 640x480 image size,
so you'd have to change one line of code to show different size images.
Yes. I used the same naming convention you used.
How do I know how many "bit" picture it is? What can I check it with?
test7.bmp
Offhand, I don't know of a program that specifically gives the color depth (when I tried to resave your pic, Paint defaults to a 24-bit save with other depths available, but I don't know if that means anything). Anyway, if you divide the actual size of the BMP file in bytes by the resolution, I think you'll get close to the number of bytes per pixel for non-small pics, as the pixel data will swamp the meta data in the header(s). When I did that for your pic (cute kid, by the way), I get quite close to 3 bytes (24 bits) per pixel. That is, 915,894 / (635x480) = 3.00490157480315, which is quite close to the 3 bytes per pixel you'd expect for a 24 bits per pixel (bpp) BMP image. So, unless there's some kind of dead space in the pixel data from a save over existing data or something strange like that (which probably can't happen), it looks like that's one way to know. But I'd guess many viewers or editors can show the color depth in bpp directly, but, offhand, I don't know of any as I haven't really worked with BMPs.
I used Paint as well to resize and save.
Anyway, to show different width images, I think you need to change these lines:
lcd.WriteBitmapLine(@lineBuffer,640,24,0)
for each bit depth and replace that "640" with "biWidth"...