About IGRAPHICS_StretchBlt() | developer.brewmp.com About IGRAPHICS_StretchBlt() | developer.brewmp.com

Developer

About IGRAPHICS_StretchBlt()

Forums:

Hi,

I want to resize the input image.
Is(or Are) there something wrong in the following code?
-----------------------------
IBitmap * pIBitmap;
IGraphics * pIGraphics;
...

pIBitmap = ISHELL_LoadResBitmap(...);
IGRAPHICS_StretchBlt(pIGraphics, 0, 0, 100, 100, pIBitmap, AEE_RO_COPY);
------------------------------

It always return Unknown Error, and
the Emulator is automatically shut down.
What can I do?

Thanks in advance for your helpful advice.

HI Bono2,
PLease do it like this
Hi,
I want to resize the input image.
Is(or Are) there something wrong in the following code?
-----------------------------
Void * pIBitmap;
IGraphics * pIGraphics;
...
pIBitmap = ISHELL_LoadResData(...);
IGRAPHICS_StretchBlt(pIGraphics, 0, 0, 100, 100, pIBitmap, AEE_RO_COPY);
------------------------------
Everything else is fine. Basically you will have to use Void pointer for pIBitmap variable and use LoadResData not LoadResImage. Also make sure that you image is a Bitmap with transparent area if any then use pink / magenta color to represent the transparent area and use AEE_RO_TRANSPARENT.
Cheers

HI Bono2,
PLease do it like this
Hi,
I want to resize the input image.
Is(or Are) there something wrong in the following code?
-----------------------------
Void * pIBitmap;
IGraphics * pIGraphics;
...
pIBitmap = ISHELL_LoadResData(...);
IGRAPHICS_StretchBlt(pIGraphics, 0, 0, 100, 100, pIBitmap, AEE_RO_COPY);
------------------------------
Everything else is fine. Basically you will have to use Void pointer for pIBitmap variable and use LoadResData not LoadResImage. Also make sure that you image is a Bitmap with transparent area if any then use pink / magenta color to represent the transparent area and use AEE_RO_TRANSPARENT.
Cheers

Hi,
It seems that the 6th parameter of IGRAPHICS_StretchBlt() isn't a IBitmap* but a pointer to real BMP data.
I was learnt how to do it in this forum :)
Here is the code ^^ pBmpData is the parameter you need.
---
AEEBmp* bmp;
byte * pBmpData;
bmp = (AEEBmp*)ISHELL_LoadResData(pApp->pShell, "resdata.bar", IMG_NUMBER, RESTYPE_IMAGE);
pBmpData=(byte *)(bmp) + *((byte *)(bmp));
// access the raw bmp data starting from pBmpData
// free the data when you are done.
ISHELL_FreeResData(pApp->pShell, bmp);
--
canard_42

Hi,
It seems that the 6th parameter of IGRAPHICS_StretchBlt() isn't a IBitmap* but a pointer to real BMP data.
I was learnt how to do it in this forum :)
Here is the code ^^ pBmpData is the parameter you need.
---
AEEBmp* bmp;
byte * pBmpData;
bmp = (AEEBmp*)ISHELL_LoadResData(pApp->pShell, "resdata.bar", IMG_NUMBER, RESTYPE_IMAGE);
pBmpData=(byte *)(bmp) + *((byte *)(bmp));
// access the raw bmp data starting from pBmpData
// free the data when you are done.
ISHELL_FreeResData(pApp->pShell, bmp);
--
canard_42

Yes you are correct, I missed that.

Yes you are correct, I missed that.

Dear pramod_kaushik and canard_42,
Thank you so much for your advice.(^^)
And I found that I can be done using IFILE interface.
But your advice seems more sophisticated than using the IFILE.(^^;
Thank you so much. I really appriciate it. m(_^_)m

Dear pramod_kaushik and canard_42,
Thank you so much for your advice.(^^)
And I found that I can be done using IFILE interface.
But your advice seems more sophisticated than using the IFILE.(^^;
Thank you so much. I really appriciate it. m(_^_)m

Thanks Kaushik and canard42
Your Code tips helped me to solve my problem.
Thanks again.
Sandy.

Thanks Kaushik and canard42
Your Code tips helped me to solve my problem.
Thanks again.
Sandy.

My source for the stretchblt is a IBitmap compatible with the display.
This crashes.
How do I get the raw data pointer from the IBitmap? I'm rendering it dynamically, it's no coming from a resource or file.
thanks

My source for the stretchblt is a IBitmap compatible with the display.
This crashes.
How do I get the raw data pointer from the IBitmap? I'm rendering it dynamically, it's no coming from a resource or file.
thanks