Problem with GetPixel

Login to reply to this topic.
Tue, 2005-08-23 09:53
Joined: 2005-08-19
Forum posts: 11
In SDK example (bmpmanip), which convert GIF to BMP but I use a JPG file instead. It can convert.  I've already opened jpg file and converted to bitmap. I would like to know how to GetPixel (I use TBitmapUtil)
because rgbData[] don't change. I GetPixel after I finish converting. Is that right?
This is my code...

iBitmap = new (ELeave) CFbsBitmap();

TRAPD(convertErr,iConverter->ConvertL(*iBitmap,KGifFrameIndex));

TSize sz = iBitmap->SizeInPixels();   
TRgb* rgbData = new (ELeave) TRgb[sz.iWidth* sz.iHeight];
TBitmapUtil bmp(iBitmap);

bmp.Begin(TPoint(0,0));       
for(TInt i = 0; i < sz.iHeight; i++)
{   bmp.SetPos(TPoint(0,i));
   for(TInt j = 0; j < sz.iWidth; j++)
     {   rgbData[i+(j*sz.iWidth)] = TRgb(bmp.GetPixel());
      bmp.IncXPos();            
   }
}
bmp.End();


With best regards, Thank you.

Tue, 2005-08-23 11:56
Joined: 2005-07-14
Forum posts: 55
Re: Problem with GetPixel
hi perra,
the way u r trying to get the pixel value might give u some serious errors.
When u call ConvertL(*iBitmap,KGifFrameIndex) function one f the virtual function of the base class MMdaImageUtilObserver gets called. ITs a kind of callback. you must override the virtual function called MIeuconvertcomplete(). After this function is called you will get ur CFbsbitmap pointer assigned.....
Then do whatever a CFbsbitmap is designed to do...
  • Login to reply to this topic.