Loading

PtoImage


processing
Since v2.1.0
Available on all platforms
See also

The PtoImage function transforms a PGRAPHICS to a PIMAGE.

The PGRAPHICS can still be used after the transformation as this function copies the pixel values. This is equivalent to Pencode Pdecode but it is a lot faster.

Signature

Examples

// @preview image 100 100 '2D' PGraphics 0xff000000 Pbackground 'pg+img' 10 15 Ptext 'pg' STORE $pg PtoImage 'img' STORE $pg 0xffff0000 Ptint // Added image will be tinted in red $img 0 20 Pimage // Add the image with an offset 'pg only' 10 60 Ptext // Pimage is a copy so this will only modify $pg Pencode