如何缩放图像 - 无论是使用Bitmap还是EncodedImage来填充字段的整个宽度和高度?
试过这个:
protected void paintBackground(Graphics g) {
super.paintBackground(g);
//try bitmap
//g.drawBitmap(0, 0, this.getWidth(), this.getHeight(), image 0, 0);
//try encoded image
g.drawImage(0, 0, this.getContentWidth(), this.getContentHeight(), image, 0, 0, 0);
}
答案 0 :(得分:2)
此处询问此问题是链接Blackberry - how to resize image?
在OS 5.0中,api scaleInto方法在Bitmap类中提供,即 http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/system/Bitmap.html#scaleInto%28net.rim.device.api.system.Bitmap,%20int%29
对于OS 5.0以下,这篇bb kb文章将有助于图像处理 http://supportforums.blackberry.com/t5/Java-Development/Rotate-and-scale-bitmaps/ta-p/492524