mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-20 12:19:31 +02:00
gtk3: create bitmap with alpha channel. Patch by Cedric. issue #27225.
git-svn-id: trunk@47267 -
This commit is contained in:
parent
e21663d02d
commit
9cd3560b15
@ -233,8 +233,6 @@ var
|
||||
ImageFormat: cairo_format_t;
|
||||
ARowStride: PtrUInt;
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
Result := False;
|
||||
ABitmap := 0;
|
||||
AMask := 0;
|
||||
@ -251,9 +249,11 @@ begin
|
||||
case Desc.Depth of
|
||||
1: ImageFormat := CAIRO_FORMAT_A1;
|
||||
2: ImageFormat := CAIRO_FORMAT_A8;
|
||||
24: ImageFormat := CAIRO_FORMAT_RGB24;
|
||||
else
|
||||
ImageFormat := CAIRO_FORMAT_ARGB32;
|
||||
if Desc.AlphaPrec=0 then
|
||||
ImageFormat := CAIRO_FORMAT_RGB24
|
||||
else
|
||||
ImageFormat := CAIRO_FORMAT_ARGB32;
|
||||
end;
|
||||
ARowStride := GetBytesPerLine(Desc.Width, Desc.BitsPerPixel, rileDWordBoundary);
|
||||
ABitmap := HBitmap(TGtk3Image.Create(NewData, Desc.Width, Desc.Height, ARowStride, ImageFormat, True));
|
||||
|
@ -639,7 +639,7 @@ begin
|
||||
gdk_pixbuf_fill(FHandle, 0);
|
||||
end else
|
||||
begin
|
||||
FHandle := TGdkPixbuf.new_from_data(AData, GDK_COLORSPACE_RGB, True, 8, width, height, bytesPerLine, nil, nil);
|
||||
FHandle := TGdkPixbuf.new_from_data(AData, GDK_COLORSPACE_RGB, format=CAIRO_FORMAT_ARGB32, 8, width, height, bytesPerLine, nil, nil);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user