黑莓 - 如何两个合并两个图像 [英] BlackBerry - how two merge two images
问题描述
我想在黑莓合并两个图像。一个图像是一个很大的图像和其他图像是一个小。小图像的位置将是开发者定义。什么是可能的方式任何一个可以帮助我,这是迫切的。
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 possible ways can any one help me out it's urgent.
感谢
推荐答案
您可以使用Graphics类绘制多个位图到它在不同的偏移。看看到<一个href=\"http://www.blackberry.com/developers/docs/4.0.2api/net/rim/device/api/ui/Graphics.html#drawBitmap%28int,%20int,%20int,%20int,%20net.rim.device.api.system.Bitmap,%20int,%20int%29\"相对=nofollow> Graphic.drawBitmap 功能。我们使用这样的:
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);
当图形对象是一个接我们覆盖和图标是大图片paint方法通过。不是决定对于较小的图像x和y位置和使用上的图形相同的方法对象:
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.
希望这有助于:)
这篇关于黑莓 - 如何两个合并两个图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!