Ecere SDK/eC Forums • View topic - Bitmap, Bitmap.Save() and BitmapResource




Ecere SDK/eC Forums

Ecere Developers Community

Bitmap, Bitmap.Save() and BitmapResource

General help with the Ecere Cross Platform GUI toolkit: Window, common controls, events, etc.
Help with the 2D Graphics library: Surface, Display, Bitmap, Font and others.

Bitmap, Bitmap.Save() and BitmapResource

Postby sacrebleu » Tue Feb 09, 2010 8:37 pm

Please explain Bitmap, Bitmap.Save() (specifically why it would return false and why it would fail) and BitmapResource.
sacrebleu
 
Posts: 27
Joined: Sun Jan 17, 2010 12:37 pm

Re: Bitmap, Bitmap.Save() and BitmapResource

Postby jerome » Thu Feb 11, 2010 1:33 am

Hi Herb,

Just a quick answer for now, but I will try to find some time to answer all these questions of yours on the forums after I set up a desk and chair over here, and the hot air of Viet Nam cool down :D

Bitmap is the core object to hold picture data, in a variety of pixel color formats. It can hold both device independent and device dependent bitmaps (Depending on whether or not you pass a display system to the Bitmap::Load method, or whether you call MakeDD or not).

BitmapResource is a higher level utility function for automatically managing the loading and unloading of bitmap data when entering or exiting a specific display driver/graphics mode. It is akin to the Window::OnLoadGraphics and Window::OnUnloadGraphics events.

Bitmap::Save() returns false if it was unable to save the bitmap to the file, if e.g. it was not able to open the specified file name for writing or if the underlying picture format library call failed. It will return false on failure and true on success.

NOTE: You want to use Save() on display independent bitmaps only (a bitmap on which MakeDD has NOT been called and initialized with a null display system).

Please let me know if you have any other specific question(s) about these.

Cheers,

Jerome
jerome
Site Admin
 
Posts: 623
Joined: Sat Jan 16, 2010 11:16 pm

Re: Bitmap, Bitmap.Save() and BitmapResource

Postby jerome » Thu Sep 08, 2011 11:20 pm

Sam,

Have you come across the sdk/samples/guiAndGfx/bitmapsAndKB sample?
It comes with a little PowerPoint tutorial as well.
You moves bitmaps around with the keyboard. The PowerPoint talks about the audio/piano sample also :)

Cool stuff 8-)
jerome
Site Admin
 
Posts: 623
Joined: Sat Jan 16, 2010 11:16 pm


Return to GUI Toolkit & 2D Graphics

Who is online

Users browsing this forum: No registered users and 11 guests

cron