[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'IntfGraphics' (#lcl)

TLazIntfImage

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Represents a graphical image.

Declaration

Source position: intfgraphics.pas line 115

type TLazIntfImage = class(TFPCustomImage)

protected

  FGetInternalColorProc: TLazIntfImageGetPixelProc;

  

  FSetInternalColorProc: TLazIntfImageSetPixelProc;

  

  procedure SetUsePalette(); override;

  

  procedure SetInternalColor(); override;

  

  function GetInternalColor(); override;

  

  procedure SetInternalPixel(); override;

  

  function GetInternalPixel(); override;

  

  procedure FreeData; virtual;

  

  procedure SetDataDescription(); virtual;

  

  procedure ChooseGetSetColorFunctions; virtual;

  

  procedure ChooseRawBitsProc();

  

  procedure GetColor_Generic();

  

  procedure GetColor_RGBA_NoPalette();

  

  procedure GetColor_RGB_NoPalette();

  

  procedure GetColor_Gray_NoPalette();

  

  procedure GetColor_GrayAlpha_NoPalette();

  

  procedure GetColor_NULL();

  

  procedure GetColor_BPP32_A8R8G8B8_BIO_TTB();

  

  procedure GetColor_BPP32_A8B8G8R8_BIO_TTB();

  

  procedure GetColor_BPP32_A8G8R8B8_BIO_TTB();

  

  procedure GetColor_BPP32_A8G8B8R8_BIO_TTB();

  

  procedure GetColor_BPP32_A8R8B8G8_BIO_TTB();

  

  procedure GetColor_BPP32_A8B8R8G8_BIO_TTB();

  

  procedure GetColor_BPP32_B8G8R8A8_BIO_TTB();

  

  procedure GetColor_BPP32_R8G8B8A8_BIO_TTB();

  

  procedure GetColor_BPP32_G8B8R8A8_BIO_TTB();

  

  procedure GetColor_BPP32_G8R8B8A8_BIO_TTB();

  

  procedure GetColor_BPP32_B8R8G8A8_BIO_TTB();

  

  procedure GetColor_BPP32_R8B8G8A8_BIO_TTB();

  

  procedure GetColor_BPP32_X8R8G8B8_BIO_TTB();

  

  procedure GetColor_BPP32_X8B8G8R8_BIO_TTB();

  

  procedure GetColor_BPP32_X8G8R8B8_BIO_TTB();

  

  procedure GetColor_BPP32_X8G8B8R8_BIO_TTB();

  

  procedure GetColor_BPP32_X8R8B8G8_BIO_TTB();

  

  procedure GetColor_BPP32_X8B8R8G8_BIO_TTB();

  

  procedure GetColor_BPP32_B8G8R8X8_BIO_TTB();

  

  procedure GetColor_BPP32_R8G8B8X8_BIO_TTB();

  

  procedure GetColor_BPP32_G8B8R8X8_BIO_TTB();

  

  procedure GetColor_BPP32_G8R8B8X8_BIO_TTB();

  

  procedure GetColor_BPP32_B8R8G8X8_BIO_TTB();

  

  procedure GetColor_BPP32_R8B8G8X8_BIO_TTB();

  

  procedure GetColor_BPP24_B8G8R8_BIO_TTB();

  

  procedure GetColor_BPP24_R8G8B8_BIO_TTB();

  

  procedure GetColor_BPP24_G8B8R8_BIO_TTB();

  

  procedure GetColor_BPP24_G8R8B8_BIO_TTB();

  

  procedure GetColor_BPP24_B8R8G8_BIO_TTB();

  

  procedure GetColor_BPP24_R8B8G8_BIO_TTB();

  

  procedure GetMask_Generic();

  

  procedure SetColor_Generic();

  

  procedure SetColor_RGBA_NoPalette();

  

  procedure SetColor_RGB_NoPalette();

  

  procedure SetColor_Gray_NoPalette();

  

  procedure SetColor_GrayAlpha_NoPalette();

  

  procedure SetColor_NULL();

  

  procedure SetColor_BPP32_A8R8G8B8_BIO_TTB();

  

  procedure SetColor_BPP32_A8B8G8R8_BIO_TTB();

  

  procedure SetColor_BPP32_A8G8R8B8_BIO_TTB();

  

  procedure SetColor_BPP32_A8G8B8R8_BIO_TTB();

  

  procedure SetColor_BPP32_A8R8B8G8_BIO_TTB();

  

  procedure SetColor_BPP32_A8B8R8G8_BIO_TTB();

  

  procedure SetColor_BPP32_B8G8R8A8_BIO_TTB();

  

  procedure SetColor_BPP32_R8G8B8A8_BIO_TTB();

  

  procedure SetColor_BPP32_G8B8R8A8_BIO_TTB();

  

  procedure SetColor_BPP32_G8R8B8A8_BIO_TTB();

  

  procedure SetColor_BPP32_B8R8G8A8_BIO_TTB();

  

  procedure SetColor_BPP32_R8B8G8A8_BIO_TTB();

  

  procedure SetColor_BPP32_X8R8G8B8_BIO_TTB();

  

  procedure SetColor_BPP32_X8B8G8R8_BIO_TTB();

  

  procedure SetColor_BPP32_X8G8R8B8_BIO_TTB();

  

  procedure SetColor_BPP32_X8G8B8R8_BIO_TTB();

  

  procedure SetColor_BPP32_X8R8B8G8_BIO_TTB();

  

  procedure SetColor_BPP32_X8B8R8G8_BIO_TTB();

  

  procedure SetColor_BPP32_B8G8R8X8_BIO_TTB();

  

  procedure SetColor_BPP32_R8G8B8X8_BIO_TTB();

  

  procedure SetColor_BPP32_G8B8R8X8_BIO_TTB();

  

  procedure SetColor_BPP32_G8R8B8X8_BIO_TTB();

  

  procedure SetColor_BPP32_B8R8G8X8_BIO_TTB();

  

  procedure SetColor_BPP32_R8B8G8X8_BIO_TTB();

  

  procedure SetColor_BPP24_B8G8R8_BIO_TTB();

  

  procedure SetColor_BPP24_R8G8B8_BIO_TTB();

  

  procedure SetColor_BPP24_G8B8R8_BIO_TTB();

  

  procedure SetColor_BPP24_G8R8B8_BIO_TTB();

  

  procedure SetColor_BPP24_B8R8G8_BIO_TTB();

  

  procedure SetColor_BPP24_R8B8G8_BIO_TTB();

  

  procedure SetMask_Generic();

  

public

  constructor Create();

  

Constructor for the class instance.

  constructor CreateCompatible();

  

Alternate constructor for the class instance.

  destructor Destroy; override;

  

Destructor for the class instance.

  procedure Assign(); override;

  

Stores values from the specified persistent object into the current class instance.

  procedure BeginUpdate;

  

Increments the internal update counter.

  procedure EndUpdate;

  

Decrements the internal update counter.

  procedure SetSize(); override;

  

SetSize - define the height and width of the image.

  function CheckDescription(); virtual;

  

CheckDescription - looks at the supplied Image Description record and returns True if it matches the actual properties of the image.

  procedure LoadFromDevice(); virtual;

  

LoadFromDevice - loads the image from the device with specified handle.

  procedure LoadFromBitmap(); virtual;

  

LoadFromBitmap - loads the image from a Bitmap.

  procedure CreateBitmaps(); virtual;

  

CreateBitmaps - generates a Bitmap and an optional Mask for the image data.

  procedure SetRawImage(); virtual;

  

Stores the raw image data in the class instance.

  procedure GetRawImage(); virtual;

  

Gets the raw image data stored in the class instance and optionally release ownership.

  procedure FillPixels(); virtual;

  

Sets the color for all pixels in the raw image data to the specified value.

  procedure CopyPixels(); virtual;

  

  procedure AlphaBlend();

  

Merges a source image with alpha blending.

  procedure AlphaFromMask();

  

Gets the alpha value from the mask if needed.

  procedure Mask();

  

  procedure GetXYDataPosition();

  procedure GetXYMaskPosition();

  function GetDataLineStart();

  

Returns an pointer to the raw data for a scan line.

  procedure CreateData; virtual;

  

  function HasTransparency; virtual;

  

  function HasMask; virtual;

  

  procedure SetDataDescriptionKeepData();

  

  property PixelData: PByte; [r]

  

PixelData - the raw image data for the image.

  property MaskData: PByte; [r]

  

MaskData - the raw data for the mask in the image.

  property DataDescription: TRawImageDescription; [rw]

  

DataDescription - the raw description record for the current image.

  property GetInternalColorProc: TLazIntfImageGetPixelProc; [r]

  

  property SetInternalColorProc: TLazIntfImageSetPixelProc; [r]

  

  property TColors []: TGraphicsColor; [rw]

  

TColors - the colors available for the specified pixel.

  property Masked []: Boolean; [rw]

  

Masked - whether the image mask applies at the specified position.

end;

Inheritance

TLazIntfImage

  

Represents a graphical image.

|

TFPCustomImage

?

TObject

Description

TLazIntfImage is a TFPCustomImage descendant which stores the image data as TRawImage, and is therefore able to interchange images directly with the LCL interfaces.

A large number of the protected methods (GetColorxxxxxx and SetColorxxxxxx) deal with direct interface to the operating system at the pixel level.

Usage examples:

1. Loading an .xpm file into a TBitmap:

var
  BmpHnd,MaskHnd: HBitmap;
  Bitmap1: TBitmap;
  IntfImg1: TLazIntfImage;
  Reader: TLazReaderXPM;
begin
  // create a bitmap (or use an existing one)
  Bitmap1:=TBitmap.Create;
  // create the raw image
  IntfImg1:=TLazIntfImage.Create(0,0);
  // get the description for the current screen (bitsperpixel, depth, ...)
  IntfImg1.DataDescription := GetDescriptionFromDevice(0);
  // create the XPM reader
  Reader:=TLazReaderXPM.Create;
  // load the image
  IntfImg1.LoadFromFile('filename.xpm',Reader);
  // create the bitmap handles
  IntfImg1.CreateBitmaps(BmpHnd,MaskHnd);
  // apply handles to the Bitmap1
  Bitmap1.Handle:=BmpHnd;
  Bitmap1.MaskHandle:=MaskHnd;
  // clean up
  Reader.Free;
  IntfImg1.Free;
  // do something with the Bitmap1
  // ...
end;

2. Saving a TBitmap to an .xpm file:

var
  BmpHnd,MaskHnd: HBitmap;
  Bitmap1: TBitmap;
  IntfImg1: TLazIntfImage;
  Writer: TLazWriterXPM;
begin
  // ...
  // create the raw image
  IntfImg1:=TLazIntfImage.Create(0,0);
  // load the raw image from the bitmap handles
  IntfImg1.LoadFromBitmap(Bitmap1.Handle,Bitmap1.MaskHandle);
  // create the XPM writer
  Writer:=TLazWriterXPM.Create;
  // save image to file
  IntfImg1.SaveToFile('filename.xpm',Writer);
  // clean up
  Writer.Free;
  IntfImg1.Free;
  // ...
end;


Version 4.0 Generated 2025-05-03 Home