scale

Fit image into ImageView, keep aspect ratio and then resize ImageView to image dimensions?

本秂侑毒 提交于 2019-12-16 20:14:08
问题 How to fit an image of random size to an ImageView ? When: Initially ImageView dimensions are 250dp * 250dp The image's larger dimension should be scaled up/down to 250dp The image should keep its aspect ratio The ImageView dimensions should match scaled image's dimensions after scaling E.g. for an image of 100*150, the image and the ImageView should be 166*250. E.g. for an image of 150*100, the image and the ImageView should be 250*166. If I set the bounds as <ImageView android:id="@+id

Scaling ImageButtons for various screen sizes

别说谁变了你拦得住时间么 提交于 2019-12-14 03:26:00
问题 For my app (runs Android 2.1 and above), I was wondering how to scale buttons for various screen sizes (virtual emulators in this case) in terms of dpi, because my scaled background images seem to be "unpixelated" perfectly fine... I scaled my button ("GOT IT" as shown below) accordingly with say, an lpdi and a xxhdpi screen, and I get the following results: For the Nexus 5 virtual emulator (xxhdpi), button supposedly at 150X34 pixels which seems to navigate to the ldpi resource director

Use xxhdpi images for xlarge layout

情到浓时终转凉″ 提交于 2019-12-14 03:15:42
问题 I created an Android app with a normal and a large layout. Now I want to create the xlarge layout, but the images are small, though I have them in all resolutions like l,m,x,xx, and xxx. Do I have to store them in double size or can I somehow use the existing ones? 回答1: Use images of 1920x1080 resolotion for Xlarge use this folder drawable-xlarge-hdpi for large use this folder drawable-large-xhdpi for me its working 回答2: Size of the images depend on the screen density of the device. It goes

AS3 Scale parent mc's center to child mc's center

倖福魔咒の 提交于 2019-12-14 02:50:23
问题 The following code centers the parent clip "mapcontainer.themap" on the state Georgia on load. However, when i try to scale mapcontainer.themap, it doesnt scale around Georgia's center. How do i keep Georgia in the center when scaling? //This sets the parent clip so it's centered on the child "georgia" clip on load var yValue:Number = mapcontainer.themap.georgia.y; var xValue:Number = mapcontainer.themap.georgia.x; var xDiff:Number = mapcontainer.themap.width/2; var yDiff:Number =

Image scale and animation improvement

时光总嘲笑我的痴心妄想 提交于 2019-12-14 02:33:22
问题 Can someone know how scale (width) to 100% of the screen a img element and keep big performances in animation ? In my first example, i set the width property to 100% . For testing purpose i made a animation loop in this fiddle to see performance chunk : http://jsfiddle.net/tXXmm/1/. I have 35fps when the image is hidden by the overflow of the parent element. When i remove the width property, i have 60fps to the same example : http://jsfiddle.net/tXXmm/2/ I need to know if there is some

How to use scaletype of a ImageView as center and matrix at the sametime?

柔情痞子 提交于 2019-12-13 20:15:06
问题 Is there a way to set the ScaleType of a ImageView as CENTER using Matrix ScaleType? I'm in need of Center orientation of an image in the ImageView. Problem occurs when I set the size of the ImageView larger than the screen say 1000dp. By doing so my image sticks to the corners. If I use layout_margins, I'm not able to pinch and zoom the image properly. Please help me find a solution. 来源: https://stackoverflow.com/questions/21366354/how-to-use-scaletype-of-a-imageview-as-center-and-matrix-at

matlab, multiple axes or scales for image pixels and real distance

别说谁变了你拦得住时间么 提交于 2019-12-13 19:33:27
问题 In matlab I have created an image of 64x64 pixels, with varying values for each pixel. But I would also like to display the real scale of the image on the plot. The real size is 1 meter and I would like to have two x-axis scales and two y-axis scales to show both pixel positions and real distance. How would i do this? 回答1: Here is an example using an approach from my answer to a previous question on SO. That's the output for some random image with 64 pixels on each dimension: The following

Viewport on Opera Mini & WM6.1 does not match 100% of the `device-width`

巧了我就是萌 提交于 2019-12-13 18:13:36
问题 sample page: 256.cz/test/ with code: meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" same CSS style for mobile view and normal view latest Opera Mini from Android Market (Android version 2.1) - scale is not 100% :-( latest Opera Mini from site Opera (Windows Mobile 6.1, Native Opera Mini, Not Java) - scale is not 100% :-( latest Opera Mini from site Opera (Sony Ericsson W995) - scale 100

Scale group of UIViews but keeping its position

你说的曾经没有我的故事 提交于 2019-12-13 17:31:22
问题 I am trying to scale multiple UIViews at once with the pinch gesture(On the base view). Though it looked straight forward, I am facing hard time getting it working properly. Assume I have 3 views stacked like this ---------------------------------------------- | | | ------- -------- | | | | | | | | | V1 | --------------- | | | | | | X | v2 | Y | v3 | | | ------- --------------- | | | | -------- | --------------------------------------------- On pinch, I am scaling each of the 3 views by

After converting my FBX file to a .gltf, the model is incredibly small, why?

折月煮酒 提交于 2019-12-13 16:08:19
问题 QUESTION: After converting my FBX file to a .gltf, the model is incredibly small, why ? I tried scaling the model with frontObject.scale.set( 1000, 1000, 1000 ); but I get the following error: TypeError: Cannot read property 'set' of undefined Furthermore, in function ( xhr ) { progressBar.style.display = "block"; progressBar.style.width = ( xhr.loaded / xhr.total * 100 ) + '%'; loadingText.innerHTML = 'Loading... '+xhr.loaded+"/"+xhr.total; // For some reason, xhr.total = 0, so I can't use