scaling

Mac OS X / Cocoa - disable WebView image scaling on Retina display

ⅰ亾dé卋堺 提交于 2019-12-24 21:18:11
问题 I am using a WebView control in my Cocoa/OS X application to display screenshots. I'm just loading the JPEG image directly to a WebView as a document. It works OK with a non-Retina screen, but in HiDPI mode the WebView is automatically scaling the loaded image up, and that's not what I need. I just need to display it as is, pixel-by-pixel. I've spent half of the day searching the web regarding how to change that WebView behavior easily and for some reason had no success. 来源: https:/

Scaling a rotated item based on top left moves the item

自闭症网瘾萝莉.ら 提交于 2019-12-24 16:43:10
问题 I would like to be able to rotate a QGraphicsItem based on its center, and scale it based on the top left corner. When I try to combine rotation and scaling, the item also apparently moves... #include <QApplication> #include <QGraphicsView> #include <QGraphicsTextItem> void testTransformations(QGraphicsScene* s) { qreal angle = 30, scaleX = 2, scaleY = 1; // Reference rotated not scaled QGraphicsTextItem* ref = new QGraphicsTextItem("bye world"); ref->setFont(QFont("Arial", 20)); ref-

CSS Transform-origin Changing with font-size

拥有回忆 提交于 2019-12-24 12:43:50
问题 I have created a simple SVG animation where it animates on click using a simple CSS transition and transform (see here: http://jsfiddle.net/T9hsW/1/). I want the SVG to scale with the user's font-size so I sized it in ems. However, I noticed that if I increase the font-size of my browse using cmd-+ then when I click the SVG, the transform-origin appears to be the old transform origin, not the new one, even though I have used % to set the origin: svg { width: 4em; height: 4em; } .arrow,

Scale and align in custom android AnalogClock hands

ぃ、小莉子 提交于 2019-12-24 10:55:46
问题 I searched the topic for several days, but finally confused. The idea is to create own alarm app with some special tricks. Firstly, I need clock hands. For creating custom clock, I used own class, which extends View. Hour and minute hands are PNG images. They should be located in the center of the screen, but they dont. Actually, I can't even see them. And that is the question. Here is the Clock class import android.annotation.SuppressLint; import android.content.Context; import android

ADO.NET Connection Pool concurency issue with SQL Azure or How we cannot scale out our Web App

亡梦爱人 提交于 2019-12-24 10:55:21
问题 We are having issues to scale out our ASP.NET Web API on Azure because of our SQL Azure DB. The issue is that our Web/Business SQL Azure DB supports a maximum of 180 concurrent requests. At multiple occasions, we've hit that limit, and the following exception is thrown: Resource ID : 1. The request limit for the database is 180 and has been reached. See 'http://go.microsoft.com/fwlink/?LinkId=267637' To prevent that to happen, we explicitly set the "Max Pool Size" property of our

How do I autoresize an image, but at the top of the ImageView (programmatically in Xcode)?

走远了吗. 提交于 2019-12-24 08:59:08
问题 I have an imageView (say 100x100) that I want to fill with a (smaller) image (say 50x10) and I want the image to go at the top of the view , not at the middle of the view. If I use imageView.contentMode = UIViewContentModeScaleAspectFit; it fills the view with the image scaled at 100x20 (as expected) but in the middle of the view. Like this: +---------+ | | |i m a g e| <---my image (scaled) | | +---------+ <---my UIImageView If I set imageView.contentMode = UIViewContentModeTop |

Swing: What is a good way to implement fully-scalable components?

我怕爱的太早我们不能终老 提交于 2019-12-24 08:25:00
问题 I am creating an application which has a scrollable and scalable (zoomable) view. Inside this view I want to place other components (most of them customized JPanel s and JInternalFrame s). Things such as fonts and borders, and sub-elements such as buttons don't need to be scalable. Only dimensions and position of container components should be. What do you think, what is a good way to implement scalable components? EDIT: I'm talking about resizing the entire layout including all components.

DPI aware screen capture

时光怂恿深爱的人放手 提交于 2019-12-24 05:54:13
问题 I used AutoIt's _ScreenCapture_Capture() before without any trouble. But on Windows 10 with a 4k resolution screen I'm using DPI scaling at 200%. _ScreenCapture_capture() now gets something 2x zoomed in and half the location I asked for. For instance : _ScreenCapture_Capture("c:\a.bmp", 100, 100, 200, 200) ; Path, X1, Y1, X2, Y2 Does not return a 100x100 pixel square of the screen (at 100,100 to 200,200 ). It returns a 100x100 pixel square (at 50,50 to 100,100 ) instead. I did find a solution

Scale affine transformation scaling differently on iOS7 and iOS8/iOS9 in Swift

被刻印的时光 ゝ 提交于 2019-12-23 19:14:07
问题 I am using scale affine transformations in Swift and have noticed CGAffineTransformMakeScale does not work the same on all iOS versions. To demonstrate the differences, I have created a new Xcode 7 project, set up three test boxes on the Xcode Storyboard running on an iOS7 device, iOS8 simulator and iOS9 simulator. Box A - has no constraints applied and is positioned centre top on the Storyboard Box B - has height and width set along with center horizontal and center vertical alignment

Scaling png font down

回眸只為那壹抹淺笑 提交于 2019-12-23 17:33:42
问题 Is there a way to scale down with highest quality a font which is png image in opengl at startup? I tried gluScaleImage but there are many artefacts. Is there anything that uses lanczos or something like that? I don't want to write a shader or anything that does the scaling runtime. 回答1: This is based on an algorithm, I copied decades ago from the German c't Magazin, and still use it from time to time for similar issues like described by OP. bool scaleDown( const Image &imgSrc, Image &imgDst,