Next: Other parts of the DIB Utilities implementation, Previous: Device Independent Bitmap Utilities, Up: Device Independent Bitmap Utilities
The following procedures have typed parameters, using the same
convention as windows-procedure
.
Return type: dib. Calls the
OpenDIB
entry of DIBUTILS.DLL. If the return value is not#f
then the file filename was found, successfully opened, and the contents were suitable for loading into memory as a device independent bitmap.
Return type: bool. Calls the
WriteDIB
entry of DIBUTILS.DLL. Returns#t
if the file filename could be opened and written to. After this operation the file contains the bitmap data in a standard format that is understood byopen-dib
and various system utilities like the bitmap editor. Any problems resulting in failure are signalled by a#f
return value.
Return type: hbitmap. Calls the
BitmapFromDib
entry of DIBUTILS.DLL. The returned value is a device dependent bitmap. The colours from the DIB are matched against colors in palette.
Return type: dib. Returns a DIB containing the same image as the device dependent bitmap bitmap. Style determines the kind of DIB, e.g. compression style. Calls the
DibFromBitmap
entry of DIBUTILS.DLL.
Return type: bool. Calls the
DibBlt
entry of DIBUTILS.DLL. Similar to the Win32 APIBitBlt
call, but draws a DIB rather than a piece of another device context. Draws the dib on device context hdc at position (x,y). A rectangle of width w and height h is copied from position (src-x,src-y) of dib. Raster-op is supposed to allow the source and destination to be combined but I don't think I got this right so stick toSRCCOPY
.
Return type: bool. This procedure reclaims the storage occupied by a DIB. After being deleted, the DIB should not be used. This procedure allows the programmer to reclaim external heap storage rather than risking it running out before the next garbage collection.
Return type: int. Calls the
DibHeight
expand entry of DIBUTILS.DLL, which returns the height of the bitmap in pixels.
Return type: int. Calls the
DibWidth
entry of DIBUTILS.DLL, which returns the width of the bitmap in pixels.
Return type: hbitmap. Calls the
CopyBitmap
of DIBUTILS.DLL, which creates a new bitmap with the same size and contents as the original.
Return type: dib. Calls the
CreateDIB
entry of DIBUTILS.DLL. Creates a DIB of width by height pixels and depth bits of colour information. The style parameter determines how the bitmap is stored. I have only ever usedBI_RGB
. If depth<=8 then the palette determines the DIB's colour table.
Return type: hbitmap. Calls the
CropBitmap
entry of DIBUTILS.DLL. Returns a new bitmap containing the image from a region of the original.
Return type: bool. Calls the
DIBSetPixelsUnaligned
entry of
DIBUTILS.DLL. Stuffs bytes from pixels into the bitmap. There are no alignment constraints on pixels (the usual way of doing this is to use theSetDIBits
function which requires that every scan line of the bitmap is 32-bit word aligned, even if the scan lines are not a multiple of 4 bytes long). doing this