Re: Loading a bitmap that was previously saved
- Posted by ArthurCrump Jun 24, 2010
- 966 views
I was attepting to cache images by saving image at exit and reloading at startup. I use the following to create the image.
error_code = copyToTrueColorBitmapFile( CleanFace, sprintf(clean_face_mask(),inner_size), 0, 0, inner_size[1]-1, inner_size[2]-1 )
CleanFace is a Pixmap. The picture saves with a good error code and I can open it with an external viewer but when I tried to load back the saved file to a Pixmap loadBitmapFromFile() the copyBlt() has no effect.
I am able to load colored bitmaps produced with gimp without any problems. The program doesn't issue me a warning or an error code. Is there something I need to do to the Pixmap before passing it to copyToTrueColorBitmapFile?
Shawn Pringle
Some time ago I used loadBitmapFromFile, using drawBitmap rather than copyBlt or bitBlt. That should not make much difference.
However, I remember reading somewhere that problems may arise if the dimensions are not exact multiples of 4. This may have been with some other image functions, but it is worth checking.