Shop OBEX P1 Docs P2 Docs Learn Events
BMP file for Ray's DVI demos — Parallax Forums

BMP file for Ray's DVI demos

Don MDon M Posts: 1,652
edited 2012-12-20 13:38 in Propeller 1
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.

Comments

  • RaymanRayman Posts: 14,667
    edited 2012-12-20 10:56
    That's strange... Was the filename in 8.3 format so that FSRW can open it?

    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.
  • Don MDon M Posts: 1,652
    edited 2012-12-20 11:27
    Rayman wrote: »
    That's strange... Was the filename in 8.3 format so that FSRW can open it?

    Yes. I used the same naming convention you used.
    Rayman wrote: »
    Besides that, I think the code can handle most formats.
    24-bit Windows bitmaps should work...

    How do I know how many "bit" picture it is? What can I check it with?
  • Don MDon M Posts: 1,652
    edited 2012-12-20 11:50
    Here's one that does not work.

    test7.bmp
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2012-12-20 12:01
    Regarding the provided "test7.bmp" bit map picture (BMP) above, when I mouse over it, Windows says it's 635x480 pixels. Also, upon downloading and saving it and then opening it with Windows Paint (included with the Windows install/OS), the size is also reported as 635x480, as opposed to 640x480. Also, according to the Wikipedia BMP entry, it appears the size of a BMP is specifically encoded in the file as meta info such that the size doesn't have to be calculated by looking at the pixel data. Whoops, just noticed that you're interested in the color depth, but that size mismatch might be an issue.

    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.
  • Don MDon M Posts: 1,652
    edited 2012-12-20 12:17
    Ok I got it to work. What I was doing was resizing them on my Mac and renaming them as a bmp file. When I took the same original and resized it and saved it with my windows pc as a bmp it now works. Even though you could open up either picture before. The Apple OS must do something different.

    I used Paint as well to resize and save.
  • RaymanRayman Posts: 14,667
    edited 2012-12-20 13:38
    Great! I think Apple might do this on purpose to mess up us Windows guys, BTW...

    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"...
Sign In or Register to comment.