PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

how do i blit just one part of a surface?

PringlesOriginal · 02 Aug 2004, 19:43 UTC
I would like to know how i could blit just a certain section of a surface onto another one using pocketfrog, any suggestions?
The "Blit" sample demonstrate how to do simply blits. The function Blit() has the following declaration:

Code:

void Blit( int destX, int destY, const Surface* source, const Rect* srcRect = 0 );


The last parameter is an optional pointer to a Rect that specifies the source rectangle on the source surface. So say you want to blit from the (32,0)-(64,32) rectangle in the source, you would do:

Code:

Rect rect( 32, 0, 64, 32 );
display->Blit( destX, destY, mySurface, ▭);
PringlesOriginal · 02 Aug 2004, 20:21 UTC
thanks a million Thierry!

Est ce que tu parles francais?
PringlesOriginal wrote:Est ce que tu parles francais?


Bien sur =)