Page 1 of 1

importing a *.bmp file

Posted: Sat Feb 10, 2018 2:51 pm
by pcls1026
Hi,
I am using the attached code to import a 16KB, BMP image file, into the Image frame frame buffer on an M7.
It gives a syntax error.
What am I doing wrong?
Jim

Re: importing a *.bmp file

Posted: Sat Feb 10, 2018 4:21 pm
by iabdalkader
Hi, you have to copy the image to the camera's SD card first, the camera can't access files on your PC and then use this path:

Code: Select all

image.image("/blkandwht.bmp")

Re: importing a *.bmp file

Posted: Wed Feb 14, 2018 6:46 am
by iabdalkader
Hi, please post your replies to this topic, don't create a new topic for each reply.

Use the Image class (note the capital I)

Code: Select all

image.Image("image.bmp")
You can't load a 900+KBs image see the memory limits in the documentation.

Re: importing a *.bmp file

Posted: Wed Feb 14, 2018 1:46 pm
by pcls1026
Hi,
Sorry about all the posts.
My updated program is attached.
I tried to attach a copy of the image file from the PC, but the following error message ensued "Invalid file extension: blkandwht12.bmp."
I tried to attach a copy of the image file from the K drive, but it did not show there. All of the other k drive files that show up using
windows explorer were there.

I changed to a capital I.
The file is 33KB.
The program runs without errors.
However, the SD card image does not load. Rather, a picture is taken by the camera and loaded.

For your info: Using windows explorer on the PC, I can see that the image file has been copied to drive K. I am assuming that drive K is the cam7 usb port because,
when I pull the cam7 usb connector out of the PC,drive K does not appear in windows explorer.

Thanks,
Jim

Re: importing a *.bmp file

Posted: Wed Feb 14, 2018 2:01 pm
by kwagyeman
Hi, the forum may require you to zip up files you post to the website.

Um, so, you put the file on the camera and tried loading it. What's the exact issue again? Sometimes our software has issues loading BMP files. We have much better support for ppm and pgm files which are easier to parse. You can make these via GIMP.

Re: importing a *.bmp file

Posted: Wed Feb 14, 2018 2:22 pm
by iabdalkader
I think you just need to add copy_to_fb=True.

Code: Select all

image.Image("file.bmp", copy_to_fb=True)