Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Correct way to use IWCanvas
#2
OnPngImageUploaded is an event that is triggered when a PNG image is uploaded, from the browser to the server. The event will be automatically triggered.

Seems to me that you are trying to draw something into the canvas. You can use LoadFromDataUrl() method. LoadFromDataUrl() takes a string as a parameter. The string can be an image encoded as Base64.

IWImageUtils unit contains a function named GraphicToBase64Str(Input: TGraphic, var Output: string);

You can pass a TPNG image to it and a string. The string will be filled with the Base64 data. Something like:

var
png: TPngImage;
s: string;
begin
png.LoadFromFile('Tick.png');
GraphicToBase64Str(png, s);
IWCanvas1.LoadFromDataUrl(s);
end;

This should work.
Reply


Messages In This Thread
Correct way to use IWCanvas - by troberts - 08-07-2023, 07:21 PM
RE: Correct way to use IWCanvas - by Alexandre Machado - 08-07-2023, 11:41 PM
RE: Correct way to use IWCanvas - by troberts - 08-09-2023, 08:17 PM
RE: Correct way to use IWCanvas - by MJS@mjs.us - 08-10-2023, 03:10 PM
RE: Correct way to use IWCanvas - by troberts - 08-14-2023, 06:10 AM
RE: Correct way to use IWCanvas - by jason2080m - 08-17-2023, 11:29 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)