scale

Zoom in Java Swing application

℡╲_俬逩灬. 提交于 2019-12-18 03:17:09
问题 I am looking for ways to zoom in a Java Swing application. That means that I would like to resize all components in a given JPanel by a given factor as if I would take an screenshot of the UI and just applied an "Image scale" operation. The font size as well as the size of checkboxes, textboxes, cursors etc. has to be adjusted. It is possible to scale a component by applying transforms to a graphics object: protected Graphics getComponentGraphics(Graphics g) { Graphics2D g2d=(Graphics2D)g;

Background in tab widget ignore scaling

丶灬走出姿态 提交于 2019-12-18 03:03:24
问题 I tried to use a background (480x320) for my tab content. Using a xml as drawable, I should be able to scale the image. This works fine outside the tabhost/tabactivity. If I try to use it inside the tabcontent, the scaleType doesn't work. He ignores every scaleType I tried. tabcontent: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="

Android: how to detect touch location on ImageView if the image view is scaled by matrix?

試著忘記壹切 提交于 2019-12-17 23:44:13
问题 I set OnTouchListener of an ImageView and implement onTouch method, but if the image is scaled using matrix, how do I calculate the location of the touch? Or does the motion event automatically takes that into account when returning getX() and getY() ? 回答1: getX and getY will return the touch location in the ImageView's coordinate system. If you're looking for the point within the image's coordinate system, you can use the inverse matrix of the matrix used by the ImageView. I've done

simple Jquery hover enlarge

旧街凉风 提交于 2019-12-17 23:27:51
问题 I'm not sure where I'm going wrong. I'm trying to create a very simple hover-enlarge plugin with Jquery using the scale function. Here is my code: $(document).ready(function(){ $("#content img").toggle("scale",{ percent: "80%" },0); $('#content img').hover(function() { $(this).css("cursor", "pointer"); $(this).toggle("scale",{ percent: "90%" },500); }, function() { $(this).toggle("scale",{ percent: "80%" },500); }); }); Here's a small example: http://jsfiddle.net/8ECh6/ Here's the page: http:

Determine precision and scale of particular number in Python

流过昼夜 提交于 2019-12-17 19:24:37
问题 I have a variable in Python containing a floating point number (e.g. num = 24654.123 ), and I'd like to determine the number's precision and scale values (in the Oracle sense), so 123.45678 should give me (8,5), 12.76 should give me (4,2), etc. I was first thinking about using the string representation (via str or repr ), but those fail for large numbers (although I understand now it's the limitations of floating point representation that's the issue here): >>> num = 1234567890.0987654321 >>>

Scaling a numeric matrix in R with values 0 to 1

只谈情不闲聊 提交于 2019-12-17 19:13:37
问题 Here is an excerpt of numeric matrix that I have [1,] 30 -33.129487 3894754.1 -39.701738 -38.356477 -34.220534 [2,] 29 -44.289487 -8217525.9 -44.801738 -47.946477 -41.020534 [3,] 28 -48.439487 -4572815.9 -49.181738 -48.086477 -46.110534 [4,] 27 -48.359487 -2454575.9 -42.031738 -43.706477 -43.900534 [5,] 26 -38.919487 -2157535.9 -47.881738 -43.576477 -46.330534 [6,] 25 -45.069487 -5122485.9 -47.831738 -47.156477 -42.860534 [7,] 24 -46.207487 -2336325.9 -53.131738 -50.576477 -50.410534 [8,] 23

C# WinForms disable DPI scaling

送分小仙女□ 提交于 2019-12-17 09:52:01
问题 I have a WinForm application which hosts many images. When I put the application on a Win7 machines that has a DPI of 120, it completely ruins the look of the form. Is there a way to disable the scaling for my form? I am aware that this is something that is not advised and that DPI should be seamless and handled by the OS. But when it comes to a skinned application, the images do not scale well. I do not have the luxury of creating images for all the DPI variations, so please don't suggest

How to force re-render after a WebKit 3D transform in Safari

浪尽此生 提交于 2019-12-17 06:36:44
问题 I'm using CSS 3D transformations to zoom a div, for example: -webkit-transform: scale3d(2,2,1); The scaling itself works fine in any WebKit browser. However, when using this on Safari (mobile or Windows), the content of the div is not re-rendered. The result is that the content gets blurred after scaling. This effect only occurs when using 3D transformations. Everything works fine when using -webkit-transform: scale(2); . In order to exploit hardware acceleration on iPhone/iPad, it would be

Process Management for the Go Webserver

倖福魔咒の 提交于 2019-12-17 05:11:53
问题 I'm a new Go programmer, coming from the world of web application and service development. Apologies is this is a herp de-derp question, but my googling around for an answer hasn't found anything. Also, this is borderline Server Fault territory, but since I'm more interested in the APIs/programmatic interfaces I'm asking here. I've written a small go program using the net/http package's built-in web server. I'm getting ready to deploy to production, but I'm a little unclear on the process of

Fit Image in ImageButton in Android

烈酒焚心 提交于 2019-12-17 04:10:58
问题 I have 6 ImageButton in my activity, I set images through my code in them ( not using xml). I want them to cover 75% of the button area. But where as some images cover less area, some are too big to fit into the imageButton. How to programatically resize and show them? Below is the screen shot below is the xml-file <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match