Discussion:
[directfb-users] cut specific area on surface problem
Jan Sipikal
2012-01-24 07:30:16 UTC
Permalink
Hi,

I'd like to ask for help in such problem:

I'm trying to cut specific area from one surface and put it into another surface.

I've blitten image ( via DirectFBImageProvider ) to surface of size 600x400 and I'd need to cut it's specific area into another surface. I'd like to
get image from surface on position [x,y]=[10,10] of size [sizeX,sizeY]=[100,100] and blit it into new surface.

I've tried to browse documentation but didn't find anything usable.
Do You think is that possible ?

I am using directfb library - 1.4.9

Should I post my code example?


PS. Sorry for my bad english ...
--
Best regards
Ján Šipikal
Andre DRASZIK
2012-01-26 12:55:06 UTC
Permalink
Hi,
Post by Jan Sipikal
I've blitten image ( via DirectFBImageProvider ) to surface of size 600x400 and I'd need to cut it's specific area into another surface. I'd like to
get image from surface on position [x,y]=[10,10] of size [sizeX,sizeY]=[100,100] and blit it into new surface.
IDirectFBImageProvider *provider;
IDirectFBSurface *full_image, *cut_image;
DFBRectangle cut_rect = { .x = 10, .y = 10, .w = 100, .h = 100 };

provider->RenderTo (provider, full_image, NULL);
cut_image->Blit (cut_image, full_image, &cut_rect, 0, 0);


should do what you want.


Cheers,
Andre'

Loading...