scaling

html5 canvas prevent linewidth scaling

倾然丶 夕夏残阳落幕 提交于 2019-12-01 02:32:59
If I draw a rectangle of say linewidth=2 and then scale it to double the size of the rectangle, I get a rectangle that has its border double the size of the initial linewidth. Is there a way to keep the linewidth to the perceived size of 2 or the original size. In short, I want to just scale the size of the rectangle but keep the linewidth visually of size 2. I tried setting the linewidth before and after the scale(2,2) command but the border width also increases. One option is to divide the linewidth by the scale factor and this will work if the x and y scale factors are the same. I don't

CGAffineTransform and scaling to center of the image

别等时光非礼了梦想. 提交于 2019-12-01 00:02:45
问题 I started studying objective-c using the iPhone and iPad apps for Absolute Beginners by Rory Lewis book but i got stuck on the 5th chapter. I want to make a button that shrinks an image. My problem is, that after I wrote all the code, the image shrinks to the point (0, 0) of the UIImageView (the top left), while in the video the image shrinks to its center. I've done some research and found out that CGAffineTransform uses the center of the object to make translations, rotations etc. So why

How to fix the Zoom problems in Google Chrome and Firefox?

大城市里の小女人 提交于 2019-11-30 23:17:10
Latest updates of Firefox and Google Chrome affects their Default Zoom scaling. It affects Fonts size, Image size and also entire Browser. Here is your Answers...... For Firefox : open up a new tab, and type about:config into the address bar, and press enter. Then use the search box, enter the word "pixel" then it will show "layout.css.devPixelsPerPx" . change the value -1.0 to 1 for 100% perfect scale... For Chrome: Right Click the chrome icon or chrome shortcut icon, go to the properties. Then in the "Target:" field, Click the field and press end button. Now you are seen this "chrome.exe" at

Scaling and translating a bitmap in android

我们两清 提交于 2019-11-30 22:10:34
I am trying to sale a bitmap and translating it at each step. If we look at the following code, I am drawing an image, translating and scaling it and then performing the same operations in reverse so as to get the original configuration back. But after applying the operations, I do get the original scaled image (scale factor 1) but the image is translated t a different position. Could you please point out the correct method do so ? (In the example above, how do I reach the original configuration? ) protected void onDraw(Canvas canvas) { super.onDraw(canvas); Matrix matrix = new Matrix(); scale

Using matplotlib, how can I print something “actual size”?

此生再无相见时 提交于 2019-11-30 22:09:15
I have a number of plots where the x- and y-axes are in centimeter units, and I am already using axis('equal') to ensure proper aspect ratios. I would like to print out those plots so that when I measure distances within my axes, the distances correspond to real-world centimeters. That is, a line that is 3 units (cm) long in the plot should print out to be 3 cm long. (A more complex example would be drawing a ruler in Matplotlib, and then printing it out for use /as/ a ruler.) I found solutions in matlab and mathematica, but not for Matplotlib. Is there a magic formula to achieve this? I

JavaFX 8 Dynamic Node scaling

 ̄綄美尐妖づ 提交于 2019-11-30 20:17:53
I'm trying to implement a scene with a ScrollPane in which the user can drag a node around and scale it dynamically. I have the dragging and scaling with the mouse wheel working as well as a reset zoom, but I'm having trouble with the calculations to fit the node to the width of the parent. Here is my code as an sscce . (works) Mouse wheel will zoom in and out around the mouse pointer (works) Left or right mouse press to drag the rectangle around (works) Left double-click to reset the zoom (doesn't work) Right double-click to fit the width If I zoom in or out or change the window size, the fit

Drawing bitmap without scaling on Android

99封情书 提交于 2019-11-30 18:57:49
问题 I was trying to drawbitmap on a canvas. In the emulator, it seems that the image is blurred. Is it likely that the android automatically scaled the bitmap? I did try to disable the scaling such as < supports-screens android:smallScreens="false" android:normalScreens="true" android:largeScreens="false" android:xlargeScreens="false" android:anyDensity="true" /> blur means if I have a pixel in the bitmap, I am seeing like 2x2 pixel. soemtimes a pixel is missing. so I assumed that Android

Scaling and translating a bitmap in android

不羁岁月 提交于 2019-11-30 17:14:52
问题 I am trying to sale a bitmap and translating it at each step. If we look at the following code, I am drawing an image, translating and scaling it and then performing the same operations in reverse so as to get the original configuration back. But after applying the operations, I do get the original scaled image (scale factor 1) but the image is translated t a different position. Could you please point out the correct method do so ? (In the example above, how do I reach the original

How to scale and position watermark to scale?

烂漫一生 提交于 2019-11-30 16:27:50
I'm scaling a video and applying a watermark like so: ffmpeg -ss 0:0:0.000 -i video.mp4 -y -an -t 0:0:10.000 -vf \"[in]scale=400:316[middle]\" -b:v 2000k -r 20 -vf 'movie=watermark.png,pad=400:316:0:0:0x00000000 [watermark];[middle] [watermark]overlay=0:0[out]' out.flv However, the applied watermark seems to be scaled to the original video size rather than the smaller scaled video size. This command line worked on ffmpeg version 0.8.6.git and now behaves differently after an upgrade to version N-52381-g2288c77 . How do I get it to work again? Update 2013-04-26: I now have tried to use the

UIWebView content not scaling between different iPhone sizes

匆匆过客 提交于 2019-11-30 16:10:56
So I am working on an iOS app that uses the UIWebView to serve HTML content. Why UIWebView and not WKWebView? well I want this app to work on iOS7 and above. I have just updated my Xcode to Xcode 6.1 and I cannot get my webView to scale to fit the available screen space when changing from the 4 inch screen size to 4.7 and above. What I am after is to have my app look consistent on all iPhone screen sizes of 4 inch and above as all my HTML5 code that is displayed on the web view is. In my Attributes inspector I have set the size to iPhone 4-inch and you can see what the app looks like in