android - Scale images inside textview using ImageGetter -
I'm trying to scan images, but I can not see.
I am using this code, but no matter, it shows the image inside the container or does not show at all.
int width, height; Display Metrics Metrics = New Performance Metals (); Matrix = resource Gate system () GetDisplayMetrics (); int BasicVissole = (int) (result.getIntrinsicWidth () * metrics.density); Int basichell scale = (int) (result. Gain intermediate height) * metrics density); If (BasicWindowsCalculate> Matrix.Width Pixels) {height = result.getIntrinsicHeight () * metrics.widthPixels / result.getIntrinsicWidth (); Width = metrics.widthPixels; } And (height = originalHeightScaled; Width = originalWidthScaled;} UrlDrawable.drawable = result; urlDrawable.setBounds (0, 0, 0 + width, 0 + height); // To change the reference of the current call to copy // HTTP // reducing the image by invalidating container.invalidate from call. // for ICS container. Sathete (container.gethit (+) + result. Gate intricacyite ()); // pre ICs container .setuppate (empty);
I have answered myself that I
(Original window Tomorrow> Matrix.width pixels) {height = result.getIntrinsicHeight () * metrics.widthPixels / result.getIntrinsicWidth (); Width = metrics.widthPixels;} if (basic_index> (metrics.width pixel * 70) / 100) {width = (metrics.widthPixels * 70) / 100; height = result.getIntrinsicHeight () * width / result.getIntrinsicWidth ( );} And now it has 70% of the screen space which is the maximum size of the container
Comments
Post a Comment