FB II Compiler
Use compressed PICT with Picture Field
All my pictures are compressed with JPEG for 2 main reasons;
1- My compiled app is far more compact;
2- Dithering is handled by QuickTime on 256 colors screen. (no need to CALL COPYBIT _dither)
BUT...JPEG is very slow to decompress !
Each time the window needs refreshing, reading the PICT in resource and decompressing it takes a long time!
How can i load the PICT into memory to avoid reading the compressed PICT each time ???
Here is how i actually call the PICT:
PICTURE FIELD#1,%128, (25,25)-(200,200), _statNoFramed, _cropPict
Since GETPICTURE doesn't _draw_ the picture, QuickTime isn't being invoked to decompress it until you actually try to draw it.
Try creating an "offscreen GWORLD" with the same depth as your screen, and use GETPICTURE/DRAWPICTURE to put it out there. Then COPYBITS it into your "visible" window. As long as you don't dispose of the GWORLD, you've got the decompressed, automatically-dithered picture available for any refreshing. Of course, you _will_ need to write more "refresh" code, since it won't be handled automatically by the FB runtime as PICTURE FIELD is.
Oh... I'll point out that you _must_ check for the presence of QuickTime and not allow your program to run if it isn't there! The one time I tried to use compression on pictures, I got "bit". It was for an educational app, and my primary beta-test site didn't have QuickTime. I wound up with a huge (CD-only, or _big_ download) app (actually multiple "data files" and a small app...), but at least I was sure it would work.