How can write CFbsBitmap object to bmp file??
Login to reply to this topic.
Thu, 2006-06-22 05:38
Joined: 2005-06-21
Forum posts: 107
Hi all!
I have CFbsBitmap object and I want to write it as bmp file !Please give me a way for do that ! thanks !
============== doctin13113 !==================

Thu, 2006-06-22 08:07
Joined: 2006-04-26
Forum posts: 28
Save()
TInt Save(const TDesC& aFilename);
Description
Saves the bitmap as a direct file store.

The file store overwrites any existing file with the same name.

Parameters
const TDesC& aFilename  The name of the file.



Return value
TInt  KErrNone if successful, otherwise another of the system-wide error codes.


Thu, 2006-06-22 09:09
Joined: 2005-06-21
Forum posts: 107
Thanks all!
I used "Save" function but my bmp file can't display on the computer because It isn't correct format .Please help me ! this my code :

void CHelloWorldPlusAppView::SaveL()
{
    TRect rect = Rect();
    CFbsBitmap* iBitmap=new(ELeave)CFbsBitmap();
    //Create a bitmap from specified rect
    iBitmap->Create(rect.Size(),EColor256);
    CCoeEnv::Static()->ScreenDevice()->CopyScreenToBitmap(iBitmap,rect);
    iBitmap->Save(_L("c:\\system\\apps\\screen.bmp"));
}
Thu, 2006-06-22 09:35
Joined: 2004-05-21
Forum posts: 286
Save as an mbm file. Then convert in to bitmap.

Cheers,
Sri
Thu, 2006-06-22 09:40
Joined: 2005-06-21
Forum posts: 107
Thanks all !
How can I convert mbm file to bmp file by code . Don't use bmconv function command line. Please give me some way ! Thanks!
Thu, 2006-06-22 09:54
Joined: 2006-04-26
Forum posts: 28
Thu, 2006-06-22 10:18
Joined: 2005-06-21
Forum posts: 107
Thanks all!
I can't access the web link .Please give me another way! Thanks!
Thu, 2006-06-22 11:18
Joined: 2004-11-29
Forum posts: 1419
Hum..  doesn't CBitmapEncoder and/or That other encoder with the long name that I don't have time to search for now, support to save to bmp?

I thought that was what the poster wanted, save a .bmp from his symbian program, by symbian code.

Not save an mbm and then convert it offline...
Thu, 2006-06-22 11:35
Joined: 2005-06-21
Forum posts: 107
Thanks all!
Hi all ! I can do that . And this my way !

void CHelloWorldPlusAppView::SaveL()
{
    //Make a snapshot
    TRect rect = Rect();
    iFileSaver->CreateL      (KBmpFileName,&iClipFormat,&iCodec,&iCodec);
    iBitmap=new(ELeave)CFbsBitmap();
    //Create a bitmap from specified rect
    iBitmap->Create(rect.Size(),EColor256); // Adapt with your display mode
    CCoeEnv::Static()->ScreenDevice()->CopyScreenToBitmap(iBitmap,rect);
}



//This function is called when the gif file has been opened or an error has occured in the process
void CHelloWorldPlusAppView::MiuoOpenComplete(TInt aError)
{
}

//This function is called whenever a conversion process has finished
void CHelloWorldPlusAppView::MiuoConvertComplete(TInt aError)
{
}

//This function is called when the bitmap (output) file has been created
void CHelloWorldPlusAppView::MiuoCreateComplete(TInt aError)
{
    iFileSaver->ConvertL(*iBitmap);
}

copyright 2003-2009 NewLC SARL