Reza Salehi
|
How to blit insttead of overwite using gf_draw_blit2?
|
Reza Salehi
06/01/2011 4:51 PM
post86355
|
How to blit insttead of overwite using gf_draw_blit2?
Hi All,
I am trying to blit two .png files. I have attached the .png files to two seperate surfaces and am using the following
code(only the important calls):
rc = gf_surface_attach(&img_surf1, gdev, image1.w, image1.h, image1.access.direct.stride, img_fmt_to_gf(image1.
format),
&palette, image1.access.direct.data, 0);
rc = gf_surface_attach(&img_surf2, gdev, image2.w, image2.h, image2.access.direct.stride, img_fmt_to_gf(image2.format)
,
&palette2, image2.access.direct.data, 0);
gf_context_create(&context);
gf_context_set_surface(context, img_surf1);
gf_draw_begin(context);
gf_draw_blit2( context, img_surf2, NULL, 107, 4, 334, 222, 0, 0);
gf_draw_end(context);
rc = img_write_file(ilib, "/tmp/reza.png", NULL, &image1);
The two images are getting combined. However, the target image is overwriting (covering) the target image.
Can someone please tell me what I need to do (probably to the context) to have the source image blited into the target
image, instead of overwriting it?
Thanks in advance,
Reza.
|
|
|