PocketMatrix forums

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

Translate image in GapiDraw.Net

I currently use the following code for rotating an image.

Code:
BackBuffer.Blt(m_map, BltOptions.GDBLT_KEYSRC | BltOptions.GDBLT_ROTATIONANGLE | BltOptions.GDBLT_ROTATIONSCALE, ref bltfx);


Because the image is bigger than the screen, I want to translate the image. How can I do this? For example, the upperleft corner should translate to coordinate -50, -50.
Another issue: the rotation center has to stay at the middle of the screen. How can I do that?

A last question: what is the difference between Blt en BltFast?

Thanks.
There is an overloaded version of Blt that takes a GDRect destRect param.

To change the rotation centre, use the BltOptions.GDBLT_ROTATIONCENTER flag, and set the cetnre point in the GDBLTFX structure.

BLtFast is faster, but supports fewer options (such as rotation and scaling). You should use BltFast whenever possible.

Take a look at the GD help at http://www.gapidraw.com/docs/gapidraw/301/index.html

It is for c++ but gd.net is basically the same except for name changes (CGapiSurface == GApiSurface etc)