Bitmap2Rsrc File: Bitmap2Rcrc.zip Author: Stephen Wardlaw, M.D. Release: 2.01 Compatability: BeOS Intel 4.5.2 Description: Do you have a bitmap and want to save it to the app's resource file? Or, do you have a bitmap and want to save it as a BPicture so you can use it in BPictureButton? Bitmap2Rsrc allows you to do either very easily. Using Bitmap2Rsrc: 1. Launch the application and either open or create a new resource file. NOTE - Since a project can have any number of resource files, I find it better to create a new resource file for each set of bitmaps, rather than a single huge file. This allows more flexibility and makes them easier to edit. 2. Choose whether you want to save the bitmap as a BBitmap or as a BPicture. The default is for saving as a BBitmap, but the 'Data' menu allows you to change this. The 'File' menu shows either a 'Add BBitmap' or 'Add BPicture', depending upon your selection. 3. Choose the 'File' menu selection 'Add BBitmap (or BPicture),. An open file dialog will appear and allow you to select the bitmap to add. Note that the image noes NOT have to be a bitmap. Any image type handled by the translators will work. 4. A dialog will then appear allowing you to set the name, and MOST IMPORTANTLY, the ID of the resource. Since all of these resources are saved as flattened BMessages as B_RAW_TYPE, each ID MUST be unique, or you will not be able to retrieve them. The ID can be entered as a 32 bit number, or, more conveniently, as a four letter code, just like that used for BMessage 'what' fields. 5. After the dialog is closed, the resource is added, and then you can add another or close the file. To use the resources in an application, simply put the resource file(s) in the project along with the utilitiy found in the 'Extracting_Bitmaps' folder. For example, to create a BPictureButton, you could do the following if you saved two bitmaps as BPictures 'Buon' and Boff'. BRect frame( some size); BPicture* picOn = ::GetAppPicture('Buon'); BPicture* picOff = ::GetAppPicture('Boff'); BPictureButton* theButton = new BPictureButton(frame,"PicButton",picOff,picOn,new BMessage(whatever)); delete picOn; // BPictureButton already copied them delete picOff; Hope this helps you make better BeApps... Stephen Wardlaw #5842