PocketMatrix forums

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

Problem using GDBLT_ROTATIONSCALE

Hi,

I'm trying to display an image which is smaller than the size of the display. I want the image to fit the display.

What I have done is to scale it. However, for some reason, when I do that it doesn't show the top of the image.

Here is my code:

Code:
CGapiSurface *pSurface;

pSurface = new CGapiSurface(m_pGapiApplication->GetGlobal());
pSurface->CreateSurface(0, m_hInstance, dwResourceID, _T("PNG"));

GDBLTFX *pGDBltFx;

pGDBltFx = new GDBLTFX;
DWORD dwFlags = GDBLT_ROTATIONANGLE | GDBLT_ROTATIONSCALE| GDBLTFAST_KEYSRC;
pGDBltFx->nRotationAngle = 0 * 100;
pGDBltFx->dwRotationScale = 200;


m_pGapiApplication->GetDisplay()->GetBackBuffer()->Blt(NULL, pSurface,NULL, dwFlags, pGDBltFx);

delete pGDBltFx;
delete pSurface;




Do you guys know where is the problem?

Thanks
This is how it looks without scaling:

http://img217.imageshack.us/img217/1346 ... ingfb7.jpg

And with scaling (using the code above):

http://img501.imageshack.us/img501/597/scalingtl8.jpg


EDIT: I don't know why the images don't show up. I have posted the links instead. Sorry about that.
Something like this will scale the graphic to fit the screen.

Code:

RECT rect;

int nWidth = m_pGapiApplication->GetDisplay()->GetBackBuffer()->GetWidth();
int nHeight = m_pGapiApplication->GetDisplay()->GetBackBuffer()->GetHeight();

::SetRect(▭, 0, 0, nWidth, nHeight);

m_pGapiApplication->GetDisplay()->GetBackBuffer()->Blt(▭, pSurface, NULL, 0, NULL);

wow! I never thought it could be so simple!
Thanks a lot, Antony.
Yep, just standard blit operation. My pleasure helping out.