How to add a TBitmap32 image to TsAlphaImageList?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #38077
    SzakiLaci
    Participant

    As I've mentioned before, Graphics32 (short: GR32) is a “must have” Delphi component pack that can handle every kind of (32 bit transparent) images extremely fast.

    But the question remains after 4+ years: (asked a similar question here before: Get part of an image from TsImage)

    – How to add TBitmap32 image to TsAlphaImageList without loosing the extra 8 bit Alpha channel?

    Code:
    var
    //imgL : TsAlphaImageList;
    b : TBitmap32;
    begin
    b := TBitmap32.Create();
    LoadBitmap32FromPNG(b, 'test.png');
    // … do different things with “b”, like resizing, etc
    imgL.AddImageGR32(^:cool:;

    procedure TsAlphaImageList.AddImageGR32(P: Pointer);
    // … how to do this?

    #58781
    Support
    Keymaster

    Hello

    You tried the 'Add' method already? Mask parameter may be empty there.

    Alpha channel of bitmap will not be lost.

    #58782
    SzakiLaci
    Participant
    'Support' wrote:

    Hello

    You tried the 'Add' method already? Mask parameter may be empty there.

    Alpha channel of bitmap will not be lost.

    No, I haven't tried it 😀 … because I knew this would happen if I try to compile:

    Code:
    [Error] Konstansok.pas(3670): Incompatible types: 'TBitmap' and 'TBitmap32'

    PS: Thanks for the quick responce.

    #58789
    Support
    Keymaster

    Yes, you should convert TBitmap32 to TBitmap with PixelFormat = pf32bit for using in this procedure.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.