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

CUTLER-HAMMER COIL 1887-1 LIGHTLY CRACKED SEE DESC UNUSED 0914
$20.0
CUTLER-HAMMER   COIL    1887-1   LIGHTLY CRACKED   SEE DESC     UNUSED      0914 pictureALLEN-BRADLEY HEATER COIL P25 UNUSED 0915
$15.0
ALLEN-BRADLEY   HEATER COIL   P25    UNUSED   0915 pictureCN15NN3A NEW IN BOX - Eaton, Size 4, Contactor 120v Coil - Free UPS Ground
$1280.0
CN15NN3A  NEW IN BOX - Eaton, Size 4, Contactor 120v Coil  - Free UPS Ground pictureGerrard 1 1/4" Steel Banding Machine with Tools, New coil of band and clips
$375.0
Gerrard 1 1/4CUTLER-HAMMER HEATER COIL 1045 UNUSED 0915
$15.0
CUTLER-HAMMER  HEATER COIL      1045   UNUSED    0915 picture






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