I'm research on how to zoom in the texts or lines which drawing on the image, and I want to know how to implement it .
public void OpenFile()
FileConnection fconn = (FileConnection)Connector.open("file:///SDCard/BlackBerry/pictures/ddd78e99bb07e70d6e068c9b.jpg");
// If no exception is thrown, then the URI is valid, but the file may or may not exist.
InputStream input = fconn.openInputStream();
int available = (int)fconn.fileSize();
byte data = new byte[available];
input.read(data, 0, available);
EncodedImage image = EncodedImage.createEncodedImage(data,0,data.length);
image.setScale(2); //zoom out the image to 50%
Bitmap b = image.getBitmap();
Graphics myGraphics = new Graphics(b);//draw a text!
myGraphics.drawText("myText", 20, 5);
BitmapField picture = new BitmapField(b);
………………//show the picture
System.out.println("Picture does not exist");
catch (Exception ioe)
As well know to all , we can zoom in or out the image by image.setScale(). I draw a text on the Bitmap got by the image.getBitmap() , but the when the image is zoomed in or out , the text is not changed , so how could I implement this?
In my opinion, I should change the bitmap b into EncodedImage after I draw the text on it. So I can call the method setScale() to zoom in or out the text with the origin image. But how can I change the bitmap b into EncodedImage?
Does anyone have any suggestions?
Thank you very much!!