BlackBerryForums.com : Your Number One BlackBerry Community      

»Sponsored Links




Reply
 
LinkBack Thread Tools
  (#1 (permalink)) Old
rab1 Offline
Knows Where the Search Button Is
 
Posts: 25
Join Date: Jul 2007
Model: 8300
PIN: N/A
Carrier: AT&T
Default Scaling a portion of a bitmap - 05-16-2008, 06:00 PM

Is there any way to convert a Bitmap back to an EncodedImage in order to scale it?

I have a large bitmap created from an EncodedImage. I scaled it fine and displayed it. The next step is to draw the same bitmap starting at a specified x and y, but I need to scale it too. The drawBitmap allows me to draw starting at a specified destination (ie. x,y) but the scaling is part of the EncodedImage. How do I translate the portion of the bitmap back to an Image in order to scale it?
Or is there another way to do this.

Any help will be appreciated.

Thanks
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
simon.hain Offline
CrackBerry Addict
 
Posts: 761
Join Date: Apr 2005
Location: hamburg, germany
Model: 8700
Carrier: o2
Default 05-19-2008, 03:49 AM

you can create an array from the bitmap, rework the array according to your wishes and build a new image from it.


java developer, Devinto, hamburg/germany
   
Reply With Quote
  (#3 (permalink)) Old
rab1 Offline
Knows Where the Search Button Is
 
Posts: 25
Join Date: Jul 2007
Model: 8300
PIN: N/A
Carrier: AT&T
Default 05-19-2008, 10:53 AM

Quote:
Originally Posted by simon.hain View Post
you can create an array from the bitmap, rework the array according to your wishes and build a new image from it.
THe question I still have, is that how can I access the data ( given an offset) from the bitmap so that I can build a new Image.

For example I would like to access the data in the bitmap starting at (x= 50, y =50). I need to read the data in a byte array so that I can manipulate it using EncodedImage. How to access/read the data back from the bitmap.

Thanks
   
Reply With Quote
  (#4 (permalink)) Old
richard.puckett Offline
Talking BlackBerry Encyclopedia
 
richard.puckett's Avatar
 
Posts: 212
Join Date: Oct 2007
Location: Seattle, WA
Model: 8800
PIN: N/A
Carrier: AT&T
Default 05-19-2008, 01:03 PM

getARGB will give you the data array. You can then use the width and height of the bitmap to step through that data however you want.


Do your homework and know how to ask a good question.
   
Reply With Quote
Reply


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-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1