BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-18-2009, 04:52 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 make a monochrome JPEGEncodedImage?

Please Login to Remove!

hi,
i'm making a screenshot of the device screen, store it into bitmap and then encode it into JPEGEncodedImage. but this image must be black and white.. how can i do that?
here is the code that i use:
Code:
Bitmap _bitmap = new Bitmap(Display.getWidth(), Display.getHeight());
Display.screenshot(_bitmap);
JPEGEncodedImage _image= JPEGEncodedImage.encode(_bitmap, 50);
how can i do JPEGEncodedImage to be monochrome??

kind regards
Offline  
Old 04-19-2009, 11:55 AM   #2 (permalink)
New Member
 
Join Date: Apr 2009
Model: 9530
PIN: N/A
Carrier: no
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i have the same question
Offline  
Old 04-20-2009, 01:08 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've found a solution. here is the code:
PHP Code:
Bitmap bmp = new Bitmap(Display.getWidth(),Display.getHeight());Display.screenshot(bmp);int x=0;int y=0;intxxx91;xxx93; argb = new intxxx91; bmp.getWidth() * bmp.getHeight() xxx93;;bmp.getARGBargb0bmp.getWidth(), xybmp.getWidth(), bmp.getHeight() );for ( int i argb.length 1>= 0; --)        {            int alpha argbxxx91;ixxx93; >> 24;            int red = (argbxxx91;ixxx93; >> 16) & 0xFF;            int green = (argbxxx91;ixxx93; >> 8) & 0xFF;            int blue argbxxx91;ixxx93; & 0xFF;                        int grey = ( red green blue ) / 3;                        int composite = (alpha << 24) | (grey << 16) | (grey << 8) | grey;                        argbxxx91;ixxx93; = composite;        }                                     bmp.setARGBargb0bmp.getWidth(), xybmp.getWidth(), bmp.getHeight()    );JPEGEncodedImage je JPEGEncodedImage.encode(bmp100); 
kind regards
Offline  
Old 04-20-2009, 07:01 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

Thanks for posting your solution.
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

Avaya 9630G IP VoIP System Phone w/Stand and Handset TESTED
$24.99
Avaya 9630G IP VoIP System Phone w/Stand and Handset TESTED pictureLOT of 220 Siemens OptiPoint 420 Standard VOIP Desk Phone S30817
$2640.0
LOT of 220 Siemens OptiPoint 420 Standard VOIP Desk Phone S30817  pictureSamsung iDCS Office Serv 100 MGI3 KP100DBMG3/XAR 8 Channel VOIP Expansion Card
$51.99
Samsung iDCS Office Serv 100 MGI3 KP100DBMG3/XAR 8 Channel VOIP Expansion Card picturePolycom IP 335 VoIP SIP Phone Telephone PoE (2200-12375-025) - NEW
$49.99
Polycom IP 335 VoIP SIP Phone Telephone PoE (2200-12375-025) - NEW picturePolycom VVX 600 16-line SIP VoIP IP Business Media Phone Bluetooth HD Voice
$174.99
Polycom VVX 600 16-line SIP VoIP IP Business Media Phone Bluetooth HD Voice picture






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