[cairo] trim margins off image

Dominic Lachowicz domlachowicz at gmail.com
Sun Feb 8 17:40:58 PST 2009


If you're working with a cairo image surface and your ImageMagick code
doesn't change the image's dimensions, it should be possible to use
something like the following Magick++ pseudo-code:

Blob blob(cairo_image_surface_get_data(surface));
Image image;
image.size(cairo_image_surface_get_width(surface),
cairo_image_surface_get_height(surface));
image.magick("ARGB");
image.read(blob);

Then manipulate the Image without needing cairo to re-read the data.

On Sun, Feb 8, 2009 at 8:30 PM, Pablo Romero <romero619 at hotmail.com> wrote:
>
> I need to trim margins off an image surface & resize the entire image, similar to imageMagick's trim & resize functions.
> I need to know if this is at all possible using cairo.
> if not, I also would like to know if it would somehow be possible to use imagemagick/magickwand to manipulate/modify a cairo surface IN MEMORY, without having to write the surface to a temporary (png) file, edit it with magickwand, and then re-read it into cairo...
>
> Has anyone ever had any success integrating code from both cairo and imagemagick???
>
> Please help.
>
> Thanks,
> P.Romero
> _________________________________________________________________
> Windows Live™: E-mail. Chat. Share. Get more ways to connect.
> http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_AE_Faster_022009
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>



-- 
Counting bodies like sheep to the rhythm of the war drums.


More information about the cairo mailing list