Sign in Join
FPDoc Onlineexperiment

TLazIntfImage class

In unit IntfGraphics

Represents a graphical image.

Declaration

pascal
TLazIntfImage = class(TFPCustomImage)

Inheritance

  1. TLazIntfImage
  2. TFPCustomImage

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;

Properties

PixelDatapublicPixelData - the raw image data for the image.
MaskDatapublicMaskData - the raw data for the mask in the image.
DataDescriptionpublicDataDescription - the raw description record for the current image.
GetInternalColorProcpublic
SetInternalColorProcpublic
TColorspublicTColors - the colors available for the specified pixel.
MaskedpublicMasked - whether the image mask applies at the specified position.

Methods

SetUsePaletteprotected
SetInternalColorprotected
GetInternalColorprotected
SetInternalPixelprotected
GetInternalPixelprotected
FreeDataprotected
SetDataDescriptionprotected
ChooseGetSetColorFunctionsprotected
ChooseRawBitsProcprotected
GetColor_Genericprotected
GetColor_RGBA_NoPaletteprotected
GetColor_RGB_NoPaletteprotected
GetColor_Gray_NoPaletteprotected
GetColor_GrayAlpha_NoPaletteprotected
GetColor_NULLprotected
GetColor_BPP32_A8R8G8B8_BIO_TTBprotected
GetColor_BPP32_A8B8G8R8_BIO_TTBprotected
GetColor_BPP32_A8G8R8B8_BIO_TTBprotected
GetColor_BPP32_A8G8B8R8_BIO_TTBprotected
GetColor_BPP32_A8R8B8G8_BIO_TTBprotected
GetColor_BPP32_A8B8R8G8_BIO_TTBprotected
GetColor_BPP32_B8G8R8A8_BIO_TTBprotected
GetColor_BPP32_R8G8B8A8_BIO_TTBprotected
GetColor_BPP32_G8B8R8A8_BIO_TTBprotected
GetColor_BPP32_G8R8B8A8_BIO_TTBprotected
GetColor_BPP32_B8R8G8A8_BIO_TTBprotected
GetColor_BPP32_R8B8G8A8_BIO_TTBprotected
GetColor_BPP32_X8R8G8B8_BIO_TTBprotected
GetColor_BPP32_X8B8G8R8_BIO_TTBprotected
GetColor_BPP32_X8G8R8B8_BIO_TTBprotected
GetColor_BPP32_X8G8B8R8_BIO_TTBprotected
GetColor_BPP32_X8R8B8G8_BIO_TTBprotected
GetColor_BPP32_X8B8R8G8_BIO_TTBprotected
GetColor_BPP32_B8G8R8X8_BIO_TTBprotected
GetColor_BPP32_R8G8B8X8_BIO_TTBprotected
GetColor_BPP32_G8B8R8X8_BIO_TTBprotected
GetColor_BPP32_G8R8B8X8_BIO_TTBprotected
GetColor_BPP32_B8R8G8X8_BIO_TTBprotected
GetColor_BPP32_R8B8G8X8_BIO_TTBprotected
GetColor_BPP24_B8G8R8_BIO_TTBprotected
GetColor_BPP24_R8G8B8_BIO_TTBprotected
GetColor_BPP24_G8B8R8_BIO_TTBprotected
GetColor_BPP24_G8R8B8_BIO_TTBprotected
GetColor_BPP24_B8R8G8_BIO_TTBprotected
GetColor_BPP24_R8B8G8_BIO_TTBprotected
GetMask_Genericprotected
SetColor_Genericprotected
SetColor_RGBA_NoPaletteprotected
SetColor_RGB_NoPaletteprotected
SetColor_Gray_NoPaletteprotected
SetColor_GrayAlpha_NoPaletteprotected
SetColor_NULLprotected
SetColor_BPP32_A8R8G8B8_BIO_TTBprotected
SetColor_BPP32_A8B8G8R8_BIO_TTBprotected
SetColor_BPP32_A8G8R8B8_BIO_TTBprotected
SetColor_BPP32_A8G8B8R8_BIO_TTBprotected
SetColor_BPP32_A8R8B8G8_BIO_TTBprotected
SetColor_BPP32_A8B8R8G8_BIO_TTBprotected
SetColor_BPP32_B8G8R8A8_BIO_TTBprotected
SetColor_BPP32_R8G8B8A8_BIO_TTBprotected
SetColor_BPP32_G8B8R8A8_BIO_TTBprotected
SetColor_BPP32_G8R8B8A8_BIO_TTBprotected
SetColor_BPP32_B8R8G8A8_BIO_TTBprotected
SetColor_BPP32_R8B8G8A8_BIO_TTBprotected
SetColor_BPP32_X8R8G8B8_BIO_TTBprotected
SetColor_BPP32_X8B8G8R8_BIO_TTBprotected
SetColor_BPP32_X8G8R8B8_BIO_TTBprotected
SetColor_BPP32_X8G8B8R8_BIO_TTBprotected
SetColor_BPP32_X8R8B8G8_BIO_TTBprotected
SetColor_BPP32_X8B8R8G8_BIO_TTBprotected
SetColor_BPP32_B8G8R8X8_BIO_TTBprotected
SetColor_BPP32_R8G8B8X8_BIO_TTBprotected
SetColor_BPP32_G8B8R8X8_BIO_TTBprotected
SetColor_BPP32_G8R8B8X8_BIO_TTBprotected
SetColor_BPP32_B8R8G8X8_BIO_TTBprotected
SetColor_BPP32_R8B8G8X8_BIO_TTBprotected
SetColor_BPP24_B8G8R8_BIO_TTBprotected
SetColor_BPP24_R8G8B8_BIO_TTBprotected
SetColor_BPP24_G8B8R8_BIO_TTBprotected
SetColor_BPP24_G8R8B8_BIO_TTBprotected
SetColor_BPP24_B8R8G8_BIO_TTBprotected
SetColor_BPP24_R8B8G8_BIO_TTBprotected
SetMask_Genericprotected
CreatepublicConstructor for the class instance.
CreateCompatiblepublicAlternate constructor for the class instance.
DestroypublicDestructor for the class instance.
AssignpublicStores values from the specified persistent object into the current class instance.
BeginUpdatepublicIncrements the internal update counter.
EndUpdatepublicDecrements the internal update counter.
SetSizepublicSetSize - define the height and width of the image.
CheckDescriptionpublicCheckDescription - looks at the supplied Image Description record and returns True if it matches the actual properties of the image.
LoadFromDevicepublicLoadFromDevice - loads the image from the device with specified handle.
LoadFromBitmappublicLoadFromBitmap - loads the image from a Bitmap.
CreateBitmapspublicCreateBitmaps - generates a Bitmap and an optional Mask for the image data.
SetRawImagepublicStores the raw image data in the class instance.
GetRawImagepublicGets the raw image data stored in the class instance and optionally release ownership.
FillPixelspublicSets the color for all pixels in the raw image data to the specified value.
CopyPixelspublic
AlphaBlendpublicMerges a source image with alpha blending.
AlphaFromMaskpublicGets the alpha value from the mask if needed.
Maskpublic
GetXYDataPositionpublic
GetXYMaskPositionpublic
GetDataLineStartpublicReturns an pointer to the raw data for a scan line.
CreateDatapublic
HasTransparencypublic
HasMaskpublic
SetDataDescriptionKeepDatapublic

Fields

FGetInternalColorProcprotected
FSetInternalColorProcprotected

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.