开发者

BlackBerry - how two merge two images

开发者 https://www.devze.com 2022-12-23 17:20 出处:网络
I want to merge two images in blackberry. one image is a big image and other image is a small one. position of small image will be define by developer. what are the po开发者_JS百科ssible ways?You can

I want to merge two images in blackberry. one image is a big image and other image is a small one. position of small image will be define by developer. what are the po开发者_JS百科ssible ways?


You can use the Graphics class to draw multiple Bitmaps onto it in different offsets. Look into the Graphic.drawBitmap function. We use something like:

graphics.drawBitmap(x1, y1, icon.getWidth(), icon.getHeight(), icon, 0, 0);

Where the graphics object is the one passed by the paint method we override and icon is the large image. Than determine the x y position for the smaller image and use the same method on the graphics object:

graphics.drawBitmap(x2, y2, mark.getWidth(), mark.getHeight(), mark, 0, 0);

Where mark is the smaller image.

Hope this helps :)

0

精彩评论

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

关注公众号