{========================================================================} {= (c) 1995-98 SwiftSoft Ronald Dittrich =} {========================================================================} {= All Rights Reserved =} {========================================================================} {= D 01099 Dresden = Tel.: +0351-8012255 =} {= Loewenstr.7a = info@swiftsoft.de =} {========================================================================} {= Actual versions on http://www.swiftsoft.de/mmtools.html =} {========================================================================} {= This code is for reference purposes only and may not be copied or =} {= distributed in any format electronic or otherwise except one copy =} {= for backup purposes. =} {= =} {= No Delphi Component Kit or Component individually or in a collection=} {= subclassed or otherwise from the code in this unit, or associated =} {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =} {= without express permission from SwiftSoft. =} {= =} {= For more licence informations please refer to the associated =} {= HelpFile. =} {========================================================================} {= $Date: 20.01.1998 - 18:00:00 $ =} {========================================================================} unit MMDIB; {$I COMPILER.INC} interface uses {$IFDEF WIN32} Windows, {$ELSE} WinProcs, WinTypes, {$ENDIF} MMSystem, MMUtils; const BFT_ICON = $4349; { 'IC' } BFT_BITMAP = $4d42; { 'BM' } BFT_CURSOR = $5450; { 'PT' } BI_BITFIELDS = 3; HALFTONE = COLORONCOLOR; { flags for _lseek } SEEK_CUR = 1; SEEK_END = 2; SEEK_SET = 0; { flags for orientation } TOPDOWN = -1; BOTTOMUP = 1; type PRGBQUAD = ^TRGBQUAD; PDIB = PBitmapInfoHeader; HDIB = THandle; (************************************************************************) procedure ClearSystemPalette; function CreateSystemColorPalette: PLogPalette; function LoadPalette(FName: string): PLOGPALETTE; function SavePalette(FName: string; pLogPal: PLOGPALETTE): Boolean; (************************************************************************) function DIB_Create(bits, orientation, width, height: integer; AllocBits: Boolean): PDIB; function DIB_ReadBitmapInfo(fh: THandle): PDIB; function DIB_OpenFile(szFile: PChar): PDIB; function DIB_SetUsage(pbi: PDIB; hPal: HPALETTE; wUsage: UINT): Boolean; procedure DIB_MapToPalette(var pbi: PDIB; hpal: HPALETTE); procedure DIB_Display(pbi: PDIB; DC: HDC; aRect: TRect); function DIB_BitmapToDIB(Handle: HBitmap; Palette: HPalette; Bits, Orientation: integer): PDIB; procedure DIB_DIBToBitmap(pbi: PDIB; var Bitmap: HBitmap; var Pal: HPalette); (************************************************************************) function IsWinDIB(pbi: PBITMAPINFOHEADER): Boolean; function HandleFrom_DIB(lpbi: PDIB): THandle; function DIB_FromHandle(h: THandle): PDIB; procedure DIB_Free(lpbi: PDIB); function DIB_Width(lpbi: PDIB): integer; function DIB_Height(lpbi: PDIB): integer; function DIB_BitCount(lpbi: PDIB): integer; function DIB_Compression(lpbi: PDIB): Longint; function DIB_NumColors(lpbi: PDIB): Longint; function DIB_WidthBytesN(lpbi: PDIB; n: integer): Longint; function DIB_WidthBytes(lpbi: PDIB): Longint; function DIB_BISize(lpbi: PDIB): integer; function DIB_SizeImage(lpbi: PDIB): Longint; function DIB_Size(lpbi: PDIB): Longint; function DIB_PaletteSize(lpbi: PDIB): Longint; function DIB_FlipY(lpbi: PDIB; y: integer): integer; function DIB_Colors(lpbi: PDIB): PRGBQUAD; function DIB_Ptr(lpbi: PDIB): Pointer; function DIB_XYN(lpbi: PDIB; pb: Pointer; x,y,n: integer): Pointer; function DIB_XY(lpbi: PDIB;x,y: integer): Pointer; function DIB_Info(pDIB: PDIB): PBitmapInfo; implementation