BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-05-2007, 12:58 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2006
Model: 8300
Carrier: Cingular
Posts: 35
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Output Image/Bitmap Raw Data

Please Login to Remove!

Greetings,


I would like my program to email an image file that I have created. Currently, it is a Bitmap and I am able to obtain the raw data through getARGB. However, I am unsure about how to transfer the data.

The getARGB function provides an integer array with the raw data of the image. However, the outputstream functions use a byte array. Does anyone know how to output the data or create an image file that can be attached to an email message?


Regards,
Californium

Last edited by Californium : 07-05-2007 at 02:40 PM.
Offline  
Old 07-05-2007, 11:29 PM   #2 (permalink)
Thumbs Must Hurt
 
Rose's Avatar
 
Join Date: Nov 2006
Location: India
Model: 9700
OS: Windows 7
Carrier: Airtel
Posts: 121
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello ,
I m not sure that it is going to help you or not. But i finds a chance with outputStream .. Using dataoutputStream we can write integer also.. Did you tried using that.
Offline  
Old 07-06-2007, 11:05 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2006
Model: 8300
Carrier: Cingular
Posts: 35
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the suggestions Rose. OutputStream ignores the top 24-bits so it won't work. However, DataOutputStream can output integers. Although I am able to output the raw data, I am now encountering the problem of displaying the image.

The getARGB function returns a rather large data array without a Bitmap header. Consequently, the receiver cannot view the image. Is there a means to serialize the Bitmap object as a data array or does anyone have code for converting an image from a raw file to a bitmap, jpeg, png, etc?

Basically, the end goal is to send a Bitmap/Image object to someone else through either email or mms. I'm thinking that I may have to write a function to add back the header information but perhaps someone has a better solution? Thanks.


Regards,
Californium

Last edited by Californium : 07-06-2007 at 01:04 PM.
Offline  




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