DrawPNG

Top  Previous  Next

function DrawPNG(x, y, w, h : Integer; 

  PNGImage : Pointer; 

  PNGImageSize : Integer; 

  OnCanvasMode : Boolean = false): Integer;

 

This method exports PNG data. It requires the PDF Engine to be able to decode PNG.

     

If OnCanvasMode=true the image will be exported in the current working state of the canvas. In that case the result value is 0, it is not possible to print duplicated images.

 

Example: draw PNG data in canvas context

        mem := TMemoryStream.Create;

        mem.LoadFromFile('transparent.png');

 

        pdf.DrawPNG(100, 100, 400, 400, mem.Memory, mem.Size, true);

        mem.Free;