Class TDIB (unit DibGraphic)

Inherits from

TGraphic

Constructors


constructor Create;



Functions

procedure Assign(Source: TPersistent);

Need to add reference counting to this later

procedure CreateDIB(Wid, Hgt, BitCount : integer);


procedure FocusPalette;

MessageBeep(0);

procedure GrayPal;

+ actual image size

procedure LoadFromClipboardFormat(AFormat: Word; AData: THandle; APalette: HPALETTE);

Write the DIB header and the bits -- use local version of MyWrite, so we can write more than 32767 bytes of data

procedure LoadFromStream(Stream: TStream);

LoadFromStream is the way to open a DIB

procedure MakeBitmap(var b: TBitmap);

Fix up the DIB Color Palette

procedure SaveToClipboardFormat(var AFormat: Word; var AData: THandle; var APalette: HPALETTE);


procedure SaveToStream(Stream: TStream);

*********************************************************************** * * SaveDIB() * * Saves the specified DIB into the specified file name on disk.

destructor Destroy;


procedure Draw(ACanvas: TCanvas; const Rect: TRect);


function GetEmpty: Boolean;


function GetHeight: Integer;


function GetPal(i: integer): TRGBQuad;


function GetPalette: HPALETTE;


function GetPixel(x,y: integer): integer;


function GetWidth: Integer;


function ReadDIBStream(Stream: TStream): HDIB;

Is this right? -bpz

procedure SetHeight(Value: Integer);


procedure SetInternals;


procedure SetPal(i: integer; p: TRGBQuad);


procedure SetPixel(x,y: integer; c: integer);


procedure SetWidth(Value: Integer);


Properties

property BitCount : integer


property Pal : TRGBQuad


property Palette : HPALETTE


property Pixel : integer


Events

Variables

FBitCount : integer;


FHeight : integer;


FPal : HPALETTE;


FWidth : integer;


hDIB : HDIB;


lpDIB : LPSTR;


lpDIBits : LPSTR;


PalBits : LPSTR;


PalChange : boolean;



Constructors


constructor Create;


Functions


procedure Assign(Source: TPersistent);

Need to add reference counting to this later


procedure CreateDIB(Wid, Hgt, BitCount : integer);


procedure FocusPalette;

MessageBeep(0);


procedure GrayPal;

+ actual image size


procedure LoadFromClipboardFormat(AFormat: Word; AData: THandle; APalette: HPALETTE);

Write the DIB header and the bits -- use local version of MyWrite, so we can write more than 32767 bytes of data


procedure LoadFromStream(Stream: TStream);

LoadFromStream is the way to open a DIB


procedure MakeBitmap(var b: TBitmap);

Fix up the DIB Color Palette


procedure SaveToClipboardFormat(var AFormat: Word; var AData: THandle; var APalette: HPALETTE);


procedure SaveToStream(Stream: TStream);

*********************************************************************** * * SaveDIB() * * Saves the specified DIB into the specified file name on disk. No * error checking is done, so if the file already exists, it will be * written over. * * Parameters: * * HDIB hDib - Handle to the dib to save * * LPSTR lpFileName - pointer to full pathname to save DIB under * * Return value: 0 if successful, or one of: * ERR_INVALIDHANDLE * ERR_OPEN * ERR_LOCK *


destructor Destroy;


procedure Draw(ACanvas: TCanvas; const Rect: TRect);


function GetEmpty: Boolean;


function GetHeight: Integer;


function GetPal(i: integer): TRGBQuad;


function GetPalette: HPALETTE;


function GetPixel(x,y: integer): integer;


function GetWidth: Integer;


function ReadDIBStream(Stream: TStream): HDIB;

Is this right? -bpz


procedure SetHeight(Value: Integer);


procedure SetInternals;


procedure SetPal(i: integer; p: TRGBQuad);


procedure SetPixel(x,y: integer; c: integer);


procedure SetWidth(Value: Integer);


Properties


property BitCount : integer


property Pal : TRGBQuad


property Palette : HPALETTE


property Pixel : integer


Events


Variables


FBitCount : integer;


FHeight : integer;


FPal : HPALETTE;


FWidth : integer;


hDIB : HDIB;


lpDIB : LPSTR;


lpDIBits : LPSTR;


PalBits : LPSTR;


PalChange : boolean;