MdaImageDescToBitmapUtility
| Mon, 2005-09-12 14:31 | |
|
I want to recieve a bitmapfile from pc to emulator.
I am using sdk socket example to get binary data from pc. void CSocketsEngine::ResponseReceived( const TDesC8& aBuffer ) { BitmapBuffer.Append(aBuffer);//after everyread,append data to picture buffer if(icompleted) //all data has been recieved { RDesReadStream rdrs; rdrs.Open(iBitmapBuffer); bmp=new(ELeave)CFbsBitmap; CleanupStack::PushL(bmp); bmp->InternalizeL(rdrs); // at this line crash rdrs.Close(); CleanupStack::PopAndDestroy(bmp); bmp->Save(_L("c:\\System\\Apps\\calismalar\\s\\1.bmp")); } bmp->InternalizeL(rdrs); At this line program crashed. Help pls! |
|






If its leaving why don't you see what the leave code is, if its crashing why don't you tell us all what the panic code is.
You can't expect an answer to your question as its currently posted.
Why don't you look at the contents of bmp and check its as you expect (i.e. what you place in the socket on the pc side)
Forum posts: 37
In pc side my bmp size 1718 byte.In emulator side coming data 1718 byte.So iBitmapBuffer's data are true.
Forum posts: 37
Forum posts: 683
Forum posts: 37
{
......
iMdaImageDescToBitmapUtility = CMdaImageDescToBitmapUtility::NewL(*this);
TDesC8& DesImage = ((TDesC8&)iResimBuffer); //iResimBuffer<2048>buf, my bitmap row data.1716 byte.
iMdaImageDescToBitmapUtility->OpenL(DesImage);
.....
}
//from MMdaImageUtilObserver
void CSocketsEngine::MiuoCreateComplete(TInt /*aError*/)
{
};
void CSocketsEngine::MiuoOpenComplete(TInt aError)
{
if( aError != KErrNone )
{
//
}
TInt frameCount = iMdaImageDescToBitmapUtility->FrameCount();
if( frameCount == 0 )
{
//
}
iBitmap = new (ELeave) CFbsBitmap();
TFrameInfo frame;
iMdaImageDescToBitmapUtility->FrameInfo(0, frame);
TSize size = frame.iOverallSizeInPixels;
iBitmap->Create(size, EColor16);
iMdaImageDescToBitmapUtility->ConvertL(*iBitmap);
}
void CSocketsEngine::MiuoConvertComplete(TInt aError)
{
if( aError == KErrNone )
{
iBitmap->Save(_L("c:\\System\\Apps\\calismalar\\gelenresimler\\1.bmp")); //saving bitmap..
}
}
-----------------------------------------------------------
No crash or leaving occured.
But when I try to open c:\\System\\Apps\\calismalar\\gelenresimler\\1.bmp with Paint an error eccured:Paint can't read this file.This is note valid bitmap file..
---------------------------------------------------------------------------------------------------
What should I do extra?
Forum posts: 683
Forum posts: 37
Thanks alot Andreas.
Forum posts: 683
And regarding my earlier post about using the CMda... image conversion classes. If you receive the bitmap as a Windows bitmap, you first need to save it to disc from your descriptor data, then you need to convert the Win bmp to Symbian one, and then you can draw it.
Forum posts: 37
And regarding my earlier post about using the CMda... image conversion classes. If you receive the bitmap as a Windows bitmap, you first need to save it to disc from your descriptor data, then you need to convert the Win bmp to Symbian one, and then you can draw it.
Now I can draw bitmap.
Thanks alot.
Forum posts: 37
In emulator with debug, first passing in loop is really speed,but the second passing is very slow..What is the problem?
void CSocketsEngine::ResponseReceived( const TDesC8& aBuffer )
{
......
iMdaImageDescToBitmapUtility = CMdaImageDescToBitmapUtility::NewL(*this);
TDesC8&Â Â DesImage = ((TDesC8&)iResimBuffer);
iMdaImageDescToBitmapUtility->OpenL(DesImage);
.....
}
//from MMdaImageUtilObserver
void CSocketsEngine::MiuoCreateComplete(TInt /*aError*/)
  {
  };
void CSocketsEngine::MiuoOpenComplete(TInt aError)
 {
   if( aError != KErrNone )
    {
      //  Â
    }
 Â
    TInt frameCount = iMdaImageDescToBitmapUtility->FrameCount();
    if( frameCount == 0 )
    {
      //  Â
    }
    iBitmap = new (ELeave) CFbsBitmap();
    TFrameInfo frame;
    iMdaImageDescToBitmapUtility->FrameInfo(0, frame);
    TSize size = frame.iOverallSizeInPixels;
    iBitmap->Create(size, EColor256);
    iMdaImageDescToBitmapUtility->ConvertL(*iBitmap);
 Â
  }
void CSocketsEngine::MiuoConvertComplete(TInt aError)
  {
    if( aError == KErrNone )
    {
      iBitmap->Save(_L("c:\\System\\Apps\\calismalar\\gelenresimler\\1.bmp")); //saving bitmap..
      iMdaImageDescToBitmapUtility->Close();
    }
  }