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

Schneider Modicon TSXP5720 Processor Premium TSX P5720 TSX P 5720 Telemecanique
$69.99
Schneider Modicon TSXP5720 Processor Premium TSX P5720 TSX P 5720 Telemecanique pictureSiemens 6ES7416-2XL00-0AB0 6ES7 416-2XL00-0AB0 SIMATIC S7-400 CPU 416-2 DP 1.6M
$3499.0
Siemens 6ES7416-2XL00-0AB0 6ES7 416-2XL00-0AB0 SIMATIC S7-400 CPU 416-2 DP 1.6M pictureGRAFIKONTROL G.9410/1 CPU CIRCUIT BOARD 9411E3
$999.95
GRAFIKONTROL G.9410/1 CPU CIRCUIT BOARD 9411E3 pictureALLEN BRADLEY 1747 L40A 1747L40A SLC 500 SERIES A PLC PROCESSOR UNIT 40 I/O NICE
$597.87
ALLEN BRADLEY 1747 L40A 1747L40A SLC 500 SERIES A PLC PROCESSOR UNIT 40 I/O NICE pictureNew Allen Bradley 1756-L74 /B 2015 ControlLogix Logix5574 Processor 16 MB
$5274.0
New Allen Bradley 1756-L74 /B 2015 ControlLogix Logix5574 Processor 16 MB  picture






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