Forum > Packages and Libraries

Copy Cairo surface image to TLazIntfImage?


What is the simplest way to copy (the content of) a Cairo surface to a TLazIntfImage? Thanks.

Which type do you have exactly? Please provide a link to the Cairo docs pointing to this type. There you should also be able to find a function to read the pixels of the cairo surface. I think that you can copy then with a loop, iterating through all pixels.

TLazIntfImage.Pixels[x,y] can be used to write to the pixels. You need to set a size for it before doing that.



So, you can either create a new TLazIntfImage, fill the raw image data and the pointer to the data, or make a double-loop to copy each pixel.

I recommend that you choose a solution, try to implement it, and then ask again more precise questions if you face problems implementing the conversion.


[0] Message Index

Go to full version