scale

Android how to get bounds of imageview with matrix

妖精的绣舞 提交于 2019-12-05 21:21:57
I have an ImageView with scaletype set to matrix, and would like to get a Rect with the bounds of the image after the transformation of the matrix. How do I get such a rect? thanks. ImageView imageView = (ImageView)findViewById(R.id.imageview); Drawable drawable = imageView.getDrawable(); Rect imageBounds = drawable.getBounds(); Then use Matrix.mapRect. 来源: https://stackoverflow.com/questions/8590693/android-how-to-get-bounds-of-imageview-with-matrix

How do I create a new scale() function in d3.js? I would like to create a cumulative distribution function

删除回忆录丶 提交于 2019-12-05 21:20:02
How do I create my own scale() function in d3? I am trying to replace the nice linear scale in d3 d3.scale.linear() with a different function that I would like to create myself. My new scale would be based on a cumulative distribution function, so that the median value would appear in the center of the x axis, and a value that was two standard deviations from the median would appear twice as far from the center of the x axis as something that was one standard deviation from the mean. Here is a link to my jsfiddle page: http://jsfiddle.net/tbcholla/kR2PS/3/ (I would appreciate any other

Image shifting/jumping after CSS transition effect with scale transform in Firefox

ぃ、小莉子 提交于 2019-12-05 20:20:32
问题 I have a problem in latest Firefox browser version 34 (system: Windows 7, screen width: 1600px). I made effect with zooming images (in some container) after hover on it. I am using transform: scale(1.1) with transition: transform 0.3s ease-in-out . But when I hover on image, and after image zoom in.. it make some strange 1px-shifting. Some rendering browser bug, but I hope that existing some fix for it. Please, help! Most important CSS definition and part of HTML code: figure { display: block

How to zoom in/out d3.time.scale without scaling other shapes bound to timeline

我的未来我决定 提交于 2019-12-05 14:23:18
http://jsfiddle.net/HF57g/ is an example of a single event(blue rect) placed on the timeline. If i zoom into the timeline, rect's placement on the x axis changes in harmony with the ticks on axis. but at the same time, rect is scaled horizontally. if i modify the following section of the code svg.selectAll(".item").attr("transform", "translate(" + d3.event.translate[0]+", 0)scale(" + d3.event.scale+", 1)"); to svg.selectAll(".item").attr("transform", "translate(" + d3.event.translate[0]+", 0)scale(1, 1)"); as in http://jsfiddle.net/HF57g/1/ to disable horizontal scaling, then the rect's

How to set the resolution of a saved image from the UIImagePickerController

佐手、 提交于 2019-12-05 10:53:11
问题 I'm using an UIImagePickerController to set a picture from my cameraroll to a UIImageView. However the image is getting scaled automaticly inside this UIImageView because I mentioned 'scale to fit' inside the IB. I'd like to save my chosen image with a resolution of 80x80 pixels so that I won't have to scale. (My App is getting realy slow because of this scaling issue.) Here's a snippit from my code: -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage :

How to scale glDrawPixels?

青春壹個敷衍的年華 提交于 2019-12-05 10:28:09
I need to scale the result of glDrawPixels image. I'm drawing a 640x480 pixels image buffer with glDrawPixels in a Qt QGLWidget. I tryed to do the following in PaintGL: glScalef(windowWidth/640, windowHeight/480, 0); glDrawPixels(640,480,GL_RGB,GL_UNSIGNED_BYTE,frame); But it doesn't work. I am setting the OpenGL viewport and glOrtho with the size of the widget as: void WdtRGB::paintGL() { glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Setup the OpenGL viewpoint glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, windowWidth, windowHeight, 0, -1.0, 1.0); glDepthMask(0); /

Can i use Calc inside Transform:Scale function in CSS?

╄→尐↘猪︶ㄣ 提交于 2019-12-05 10:26:01
I'm trying to calculate the right scale to apply to children inside a parent but i can't use calc() inside transform: scale CSS function. I've done this function with javascript but i'm interested in a pure CSS solution to avoid bloating the page with scripts as much as possible. Example: CSS .anyclass{ height:250px; /*this value can change dinamically */ transform:scale(calc(100% / 490 )); /*is using height value*/ } This definition gives back an invalid property value. Other uses like translate: .anyclass{ transform:translate(calc(100% - 50px )); } works with no problem. Is there anyway i

WPF Application same size at every system scale (scale independent)

时光总嘲笑我的痴心妄想 提交于 2019-12-05 09:53:29
Is there any way to make WPF application get same size at every system scale? When I change Change size of text, apps and other items in windows system setting from 125% (Recommended) to 100% in a Full-HD screen, My WPF application gets too small. To implement independent system scale application I've wrote a function like this to change scaling of my app back to 125%: private void ScaleTo125Percents() { // Change scale of window content MainContainer.LayoutTransform = new ScaleTransform(1.25, 1.25, 0, 0); Width *= 1.25; Height *= 1.25; // Bring window center screen var screenHeight = System

move,scale and crop the image in android like facebook profile picture

点点圈 提交于 2019-12-05 06:23:58
I want crop an image in my application.I tried a lot but not succeed. Its challenge to android developer. Is there any idea or reference to implement the features move,scale and crop the image in android like facebook upload profile pic. Now i am able to move, scale and crop and the image.But not consistant like facebook.I want to set fix image scale based on orientation.I attached the screen shot-3. My code as below:- crop_image.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout

Scale UIView without scaling subviews

坚强是说给别人听的谎言 提交于 2019-12-05 05:38:02
I'm trying to scale an UIView without scaling its subviews, or in my case I just want the subviews to be scaled in one axis. I need these hierarchy because I'm setting some Gesture Recognizers to detect panning and rotation and I want these to happen simultaneously with the parent view. However, I don't want the scaling to happen simultaneously. For some subviews I want it to happen only vertically or horizontally or no scaling at all. Is there a way to control the auto-scaling in an UIView's subviews when using CGAffineTransform on the UIView? If you ensure the autoresizingMask's of subviews