BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-21-2009, 07:19 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default how to save bitmap to *.bmp file?

Please Login to Remove!

hi,
how can i save bitmap to *.bmp file? i'm making a screenshot, store it to the bitmap:
Code:
Bitmap _bitmap= new Bitmap(Display.getWidth(), Display.getHeight());
		Display.screenshot(_bitmap);

and i want to write it to the *.bmp file. how can i do this?
Offline  
Old 04-21-2009, 08:34 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

You questions have me curious as to what you're working on. I will try to contain myself.

Unfortunately from what I've come across the API seems limited to reading images and displaying them, not saving to files. I don't think the BMP format is very complex though so you may be able to write your own routine.

I did find net.rim.device.api.system.EncodedImage.getData(), there is a subclass net.rim.device.api.system.BMPEncodedImage,
which "Returns the encoded data of this image." But how close that is to the file format I do not know.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 04-22-2009, 12:54 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i need to store bitmap to bmp just to compare smth (too long to explain). getData() method may be used only for PNG and JPEG. BMPEncodedImage was aslo checked by me, and to use it i must first make a jpg(or png) from my bitmap and then store it to BMPEncodedImage.. but unfortunatelly it is not a BMPImage!! it is still a jpg(or png, depend on what we used). so i do not know if it is a bug in rim's api or i do not know what.
anyway i just must dump a bitmap to *.bmp image..
Offline  
Old 04-22-2009, 07:48 AM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Sorry, no more ideas here.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 04-22-2009, 09:26 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Feb 2009
Model: 9000
PIN: N/A
Carrier: T-Mobile
Posts: 67
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

use the FileConnection api
Offline  
Old 04-29-2009, 01:29 AM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

yhh... i did. but the problem is that You can store an image only to png or jpg. and i'm looking for an idea of how to store it as a bitmap!
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.