PDA

View Full Version : _LVOOpenScreen() Bitmap


redblade
02 October 2006, 02:16
Hi

I open a screen with a depth of 1, and I want to load a 320x256x1bitplane bitmap to it.

Does the bitmap in the Screen Structure point to the Bitmap or does it point to a bitmap structure?

thanks.

ganralf
02 October 2006, 19:03
Screen->BitMap is an embedded BitMap structure and not a pointer. For that reason this BitMap structure is not allowed to grow and one should access Screen->RastPort->BitMap (which is a pointer to the screen's BitMap structure).

Anyway for your purpose you should allocate a BitMap before opening the screen and supply that structure to OpenScreen():

myBitMap=AllocBitMap(320,256,1,BMF_DISPLAYABLE,NULL);
Load you graphic to myBitMap->Planes[0];
myScreen=OpenScreenTags(NULL, ... , SABitMap, myBitMap , ... );

This will save memory and avoid flicker.

redblade
02 October 2006, 23:25
thanks