taking a small section of a huge .png for an ImageView

All your problems with Audio, Video and Images.

taking a small section of a huge .png for an ImageView

Postby jacobbeu » Mon Sep 05, 2011 9:58 pm

I have this big .png file thats dimensions are 2365x1784. I have set up certain coordinates on the image that when I click on the image I call a custom alert dialog that has an ImageView. I was wondering if there was a way I could get a small 100x100 from the area that I clicked on the big .png without having to load it again. Or do I just need to draw all the images I want to cut out for my ImageView?
jacobbeu
Freshman
Freshman
 
Posts: 4
Joined: Fri Aug 12, 2011 6:33 am

Top

Re: taking a small section of a huge .png for an ImageView

Postby dmurarik » Thu Sep 08, 2011 9:14 pm

Try..

Canvas.
drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint)
Draw the specified bitmap, scaling/translating automatically to fill the destination rectangle.
Then
canvas.drawRect(dst);

or
Modify it with matrix
drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint)
Draw the bitmap using the specified matrix.

Using the same bitmap you previously saved


http://developer.android.com/reference/ ... anvas.html
dmurarik
Freshman
Freshman
 
Posts: 8
Joined: Tue Oct 26, 2010 6:02 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 12 guests