rid.Width := Width;
rid.Height := Height;
- rid.Depth := CountSetBits(FormatDesc.Range.r or FormatDesc.Range.g or FormatDesc.Range.b or FormatDesc.Range.a);
+ rid.Depth := CountSetBits(FormatDesc.RedMask or FormatDesc.GreenMask or FormatDesc.BlueMask or FormatDesc.AlphaMask);
rid.BitOrder := riboBitsInOrder;
rid.ByteOrder := riboLSBFirst;
rid.LineOrder := riloTopToBottom;
var
png: TPortableNetworkGraphic;
intf: TLazIntfImage;
+ raw: TRawImage;
begin
png := TPortableNetworkGraphic.Create;
intf := TLazIntfImage.Create(0, 0);
try
if not AssignToLazIntfImage(intf) then
raise EglBitmap.Create('unable to create LazIntfImage from glBitmap');
- png.LoadFromIntfImage(intf);
+ intf.GetRawImage(raw);
+ png.LoadFromRawImage(raw, false);
png.SaveToStream(aStream);
finally
png.Free;
var
jpeg: TJPEGImage;
intf: TLazIntfImage;
+ raw: TRawImage;
begin
jpeg := TJPEGImage.Create;
intf := TLazIntfImage.Create(0, 0);
try
if not AssignToLazIntfImage(intf) then
raise EglBitmap.Create('unable to create LazIntfImage from glBitmap');
- jpeg.LoadFromIntfImage(intf);
+ intf.GetRawImage(raw);
+ jpeg.LoadFromRawImage(raw, false);
jpeg.SaveToStream(aStream);
finally
intf.Free;
FreeAndNil(InitOpenGLCS);
{$ENDIF}
-end.
+end.
\ No newline at end of file