Board index » cppbuilder » How to resize GIF Image

How to resize GIF Image


2007-01-17 08:55:25 PM
cppbuilder111
Hi all
HOw can we resize GIF Image .
I can get the RGB Data of an image . I am using OleLoadPicture,
GetDIBits functions to get the data.
Plz help me to downsize the image say half the size of original image .
code to store RGB data in buffer is as .
RGB Data is in newbuf.
Any help will be appticiated .
Thanks
Kiarn chikhale
for (int i=0; i<newHeight; ++i)
{
for (int j=0; j<newWidth; ++j)
{
long lVal=0;
memcpy(&lVal, &buf[nCount], 4);
// Get the reverse order
int b = GetRValue(lVal);
int g = GetGValue(lVal);
int r = GetBValue(lVal);
lVal = RGB(b, g, r);
memcpy(&newbuf[newCount], &lVal, 4);
newCount+=4;
nCount +=8;
}
}
 
 

Re:How to resize GIF Image

No need to access the pixels using GetData.
Just use or StretchDIBits or insert your HBITMAP handle in a HDC handle and
use StretchBlt.
msdn will help you for the syntax.