How to obtain top left corner of bitmap in Canvas Android

Put your problem here if it does not fit any of the other categories.

How to obtain top left corner of bitmap in Canvas Android

Postby nisha.113a5 » Fri Feb 10, 2012 8:40 am

hello everybody,

I wanted to put bitmap holder (through which i can rescale the bitmap) at top left corner of the bitmap. As i can able to put successfully at top left corner of the bitmap, but when I rescale the bitmap, at that time, could not recalculate the X and Y of bitmap holder.



Thank You!
Nisha
nisha.113a5
Junior Developer
Junior Developer
 
Posts: 14
Joined: Sat Sep 19, 2009 12:35 pm

Top

Re: How to obtain top left corner of bitmap in Canvas Androi

Postby Phyll » Fri Feb 10, 2012 12:27 pm

Hi nisha,

I don't know if this is what you are looking for or not but I had a similar problem of not knowing where the x and y were on a scaled bitmap. I used this:

Bitmap tmp = Bitmap.createScaledBitmap(head, displayWidth, displayHeight, false);

to make a scaled bitmap of the one I was drawing on the view and used it for a hit test.

Hope this helps.

Phyll
Phyll
Master Developer
Master Developer
 
Posts: 648
Joined: Fri Oct 14, 2011 11:19 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 13 guests