|
|
@@ -4920,7 +4920,7 @@ begin |
|
|
|
|
|
|
|
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; |
|
|
@@ -5977,13 +5977,15 @@ procedure TglBitmap.SavePNG(const aStream: TStream); |
|
|
|
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; |
|
|
@@ -6513,13 +6515,15 @@ procedure TglBitmap.SaveJPEG(const aStream: TStream); |
|
|
|
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; |
|
|
@@ -8559,4 +8563,4 @@ finalization |
|
|
|
FreeAndNil(InitOpenGLCS); |
|
|
|
{$ENDIF} |
|
|
|
|
|
|
|
end. |
|
|
|
end. |