Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working with PNG data
#5
I didn't know that this problem could be solved by Indy, so I wrote to the Delphi forum. And in the end I solved the problem without Indy. Thanks again.

uses pngimage, EncdDecd
procedure TfmViewQRC.ShowQRC(mContent: String);
var
mStream1 : TMemoryStream;
mStream2 : TMemoryStream;
mPng : TPngobject;
begin
mStream1 := TMemoryStream.Create;
mStream2 := TMemoryStream.Create;
mPng := TPNGObject.Create;
try
mStream1.WriteBuffer(mContent[1],Length(mContent)*SizeOf(Char));
mStream1.Position:=0;
DecodeStream(mStream1,mStream2);

mStream2.Position := 0;
mPng.LoadFromStream(mStream2);
Image1.Canvas.Draw(0,0,mPng);
finally
mStream1.Destroy;
mStream2.Destroy;
mPng.Destroy;
end;
end;
Reply


Messages In This Thread
RE: Working with PNG data - by kudzu - 05-13-2022, 06:23 PM
RE: Working with PNG data - by rlebeau - 05-15-2022, 01:23 AM
RE: Working with PNG data - by Сергей Александрович - 05-16-2022, 05:15 AM
RE: Working with PNG data - by Alexandre Machado - 04-16-2023, 11:44 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)