How to merge bitmaps?

All your problems with Audio, Video and Images.

How to merge bitmaps?

Postby navajo » Sat Jun 20, 2009 7:05 pm

Hi,
i have a view where i override the onDraw-method to get a compass-bitmap with the needle showing in a calculated direction on screen. Compass and needle are png-images and i use matrix.setRotate-Method to transform both bitmaps according to orientation of the device and the calculated direction for the needle.
Till now i transform the compass-image, draw it, then transform the needle-image and draw it afterwards. Now i realised that i could merge both bitmaps into one bitmap and draw it at once.
How can i do this programmaticaly? Is it possible to take A-bitmap and B-bitmap of same size and merge them to a bitmap C, so that it looks like B is on top of A?

I hope my explanation of the problem is understandable. If not, please let me know.

Thanks in advance,
navajo
In a world without walls and fences... who needs Windows and Gates?
navajo
Junior Developer
Junior Developer
 
Posts: 15
Joined: Fri Dec 21, 2007 5:55 pm
Location: Germany

Top

Postby WarrenFaith » Sat Jun 20, 2009 9:58 pm

If you want to draw a compass, why would you also rotate your compass? only the needle should change....

anyway: My experience is that drawing even large images (done with a full background image) is more efficient than loading an image...
So its fast enough to load 2 bitmaps and draw them from the cache....
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

Postby navajo » Sun Jun 21, 2009 4:29 pm

I am aware of all the points u mentioned.
Still i'd like to know how i can specifically solve the above described problem.

Thanks,
navajo
In a world without walls and fences... who needs Windows and Gates?
navajo
Junior Developer
Junior Developer
 
Posts: 15
Joined: Fri Dec 21, 2007 5:55 pm
Location: Germany

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 9 guests