开发者

Blackberry - set field background image stetched to fit

How can you scale an image - whether it be using Bitmap or EncodedImage to fill the entire width and height of 开发者_StackOverflowa field?

Tried this:

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);

}


This questn is asked before here is link Blackberry - how to resize image?

In OS 5.0 the api scaleInto method is provided in Bitmap class i.e 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

For Below OS 5.0 this bb kb article will be helpful for image manipulations http://supportforums.blackberry.com/t5/Java-Development/Rotate-and-scale-bitmaps/ta-p/492524

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜