Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - How to blit insttead of overwite using gf_draw_blit2?: Page 1 of 5 (5 Items)
   
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.