Unit 'agraphics' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#aros]

AllocBitMap

Allocate a bitmap and attach bitplanes to it.

Declaration

Source position: agraphics.pas line 2187

function AllocBitMap(

  Sizex: LongWord;

  Sizey: LongWord;

  Depth: LongWord;

  Flags: LongWord;

  Friend_Bitmap: PBitMap

):PBitMap;

Arguments

Sizex

  

The width (in pixels) desired for the bitmap data.

Sizey

  

The height (in pixels) desired.

Depth

  

The number of bitplanes deep for the allocation. Pixels with at least this many bits will be allocated.

Flags

  

Flags for Bitmap creation (BMF_*)

Friend_Bitmap

  

Pointer to another bitmap, or nil. If this pointer is passed, then the bitmap data will be allocated in the most efficient form for blitting to friend_bitmap. if Flags BMF_FRIENDISTAG is set this link points to a Taglist (BMATags_*)

Description

Allocates and initializes a bitmap structure. Allocates and initializes bitplane data, and sets the bitmap's planes to point to it.

BMF_CLEAR
to specify that the allocated raster should be filled with color 0.
BMF_DISPLAYABLE
to specify that this bitmap data should be allocated in such a manner that it can be displayed. Displayable data has more severe alignment restrictions than non-displayable data in some systems.
BMF_INTERLEAVED
tells graphics that you would like your bitmap to be allocated with one large chunk of display memory for all bitplanes. This minimizes color flashing on deep displays. If there is not enough contiguous RAM for an interleaved bitmap, graphics.library will fall back to a non-interleaved one.
BMF_MINPLANES
causes graphics to only allocate enough space in the bitmap structure for "depth" plane pointers. This is for system use and should not be used by applications use as it is inefficient, and may waste memory.

NOTE:

When allocating using a friend bitmap, it is not safe to assume anything about the structure of the bitmap data if that friend BitMap might not be a standard amiga bitmap (for instance, if the workbench is running on a non-amiga display device, its Screen^.RastPort^.BitMap won't be in standard amiga format. The only safe operations to perform on a non-standard BitMap are:

Good arguments to pass for the friend_bitmap are your window's RPort^.BitMap, and your screen's RastPort^.BitMap. Do not pass @(screenptr^.BitMap)!

BitMaps not allocated with BMF_DISPLAYABLE may not be used as Intuition Custom BitMaps or as RasInfo^.BitMaps. They may be blitted to a BMF_DISPLAYABLE BitMap, using one of the BltBitMap() family of functions.

See also

FreeBitMap

  

Free a bitmap created by AllocBitMap()


Documentation generated on: 2021-07-30