BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 03-30-2007, 01:43 PM   #1 (permalink)
New Member
 
Join Date: Jan 2007
Location: Ottawa
Model: 8100
Carrier: Rogers
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Image Zoom

Please Login to Remove!

I have planned to add zoom in and zoom out functions to my blackberry program.
Code:
                    
myImage = EncodedImage.createEncodedImage(bytes,0,-1).scaleImage32(xScale,yScale);
updateBitmap(myImage);

private void updateBitmap(final EncodedImage myImage) {
    _mainScreen.getApplication().invokeLater(new Runnable() {
        public void run(){
                _imageField.setImage(myImage);
            }
        });
    }
The program can zoom in or out by changing the values of xScale and yScale. However, when I zoom in, the bitmap field only shows the upper left corner of the original graph. Does anybody know a way to show the center part of the original image when I zoom in and by moving the wheel ball it can show any part of the original graph.

Thanks ahead.
Offline  
Old 04-01-2007, 05:50 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

if I understand properly, type of _imageField variable is BitmapField.

I can suggest to create your own Field and implement Field.paint(Graphics g) there. There is Graphics.drawImage(int x, int y, int width, int height, EncodedImage image, int frameIndex, int left, int top), which you can use there and you can set left and top variables to define necessary part of your image.
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

Littelfuse KLC100 Rectifier Fuse 100 AMP, KLC 100, 600 Volt "SameDayShip"NEW"
$21.99
Littelfuse KLC100 Rectifier Fuse 100 AMP, KLC 100, 600 Volt CARRIER BRYANT FURNACE RECTIFIER CONTROL BOARD HK 61EA 003 HK61EA003 PI
$21.95
CARRIER BRYANT FURNACE RECTIFIER CONTROL BOARD HK 61EA 003 HK61EA003 PI pictureCooper Bussmann KAC-80 Tron Rectifier Fuse
$69.99
Cooper Bussmann KAC-80 Tron Rectifier Fuse pictureNew Marquette SCR Diodes 125 Amp for Battery Charger
$49.0
New Marquette SCR Diodes 125 Amp for Battery Charger picture2N4442 Motorola Silicon Controlled Rectifier SCR Thyristor Transistor NOS Qty 1
$4.49
2N4442 Motorola Silicon Controlled Rectifier SCR Thyristor Transistor NOS Qty 1 picture






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