Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
140 user(s) are online (122 user(s) are browsing Forums)

Members: 0
Guests: 140

more...

Support us!

Headlines

 
  Register To Post  

Cairo : How to create an image from a memory RGBA/ARGB buffer ?
Quite a regular
Quite a regular


See User information
Hi,

I've seen that I can create an image into Cairo from a PNG file but, I'd like to know how I can create an image from a memory buffer ?

Kindest Regards,
AmiDARK

All we have to decide is what to do with the time that is given to us.
Go to top
Re: Cairo : How to create an image from a memory RGBA/ARGB buffer ?
Just can't stay away
Just can't stay away


See User information
cairo_surface_t *surface;
surface cairo_image_surface_create_for_data(buffer,
    
CAIRO_FORMAT_ARGB32widthheightbpr);


Where buffer is the pointer to your ARGB buffer, width and height are the pixel dimensions of the surface to create and the bpr value is the bytes per row value (number of bytes to add to buffer pointer to get to the beginning of the next line). Unless your ARGB buffer has extra padding the bpr value should always be width*4.

Go to top
Re: Cairo : How to create an image from a memory RGBA/ARGB buffer ?
Quite a regular
Quite a regular


See User information
@Salass00 :
Thank you.
It's what I expected but as I'm french ... sometimes ... I'm not sure of my "english2French" translation :p

Regards,
AmiDARK

All we have to decide is what to do with the time that is given to us.
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project