[fpc-pascal] AggPas / PTCGraph dynamic memory allocation

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Sat Nov 11 10:01:01 CET 2017


On 2017-11-11 01:48, James Richters wrote:
> I can use a dynamic method with PTCGraph with getimage and putimage 
> But if I allocate memory this way, while it works fine with getimage
> and putimage, I can't figure out how to use it with AggPas because
> the first 3 words are not part of the bitmap data...


AggPas doesn't care where or what the data buffer is, as long as you 
tell AggPas where to start, width, height and stride. So use GetImage, 
assign that buffer to a pointer. Increment the pointer by (3 * 
Size(Word)) and give that pointer to agg.Attach().

That should do the trick.

Regards,
   Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp



More information about the fpc-pascal mailing list