scaling

Swing: resize Image but keep same size

北城以北 提交于 2020-01-17 01:18:46
问题 I want to be able to do something similar to resize canvas in gimp I want to generate a bunch of images to a certain width. I used int width = (int)(size * fraction); int height =(int)(size*icon.getIconHeight()/icon.getIconWidth()*fraction); miniature = new ImageIcon(i.getScaledInstance(width, height, Image.SCALE_SMOOTH)); this goes well while I'm doing fraction 1 but I have 3 images that have the same source but are different size (1, 2/3, 1/3) the problem is I have and image A I want to

Android: Position by percentage?

社会主义新天地 提交于 2020-01-15 12:27:07
问题 I have a UI Design from my designer, and it exists of a background map with several buttons on it, positioned non-linear all over the map. Currently I position them in a RelativeLayout that is as large as the map, and use margin-left and margin-top etc in dip . This works ok, but I also need to account for users with very small screens, that cause the map to scale down. My relative layout scales with it, but the margin values ofcourse not. So I am wondering, how should I do this? I would

How to scale up a PDF containing a vector-based graphic drawn by CGContextDrawPDFPage in Cocoa Touch

不问归期 提交于 2020-01-13 20:12:44
问题 ok so here is what I want to do: Load a PDF containing a vector graphic Scale it up Draw it to a graphics context Create a UIImage from the result and present it Everything works fine, except the fact that the graphic loses quality and looks pixelized :( Here is the code where the scaling happens: // PDF loaded before CGPDFPageRef page = CGPDFDocumentGetPage (document, 1); UIGraphicsBeginImageContext(CGSizeMake(width, height)); CGContextRef context = UIGraphicsGetCurrentContext();

My WPF app is per-monitor dpi-aware out of the box. I was not expecting that?

ぐ巨炮叔叔 提交于 2020-01-12 18:53:08
问题 I am a bit confused about per-monitor dpi-aware in WPF. I thought you need to do some work to make your windows scale properly on different monitors (as described in Developing a Per-Monitor DPI-Aware WPF Application). But I've just ran my app on pc with two monitors (2560x1440 and 2160x1440) and the dialogue would automatically scale itself when I move it between monitors. That's on the latest fast ring Windows 10. Am I missing something? 回答1: What you see is an example of System scaling

Stackpanel: Height vs ActualHeight vs ExtentHeight vs ViewportHeight vs DesiredSize vs RenderSize

最后都变了- 提交于 2020-01-11 15:47:30
问题 i want to know the height of all items my StackPanel . What is the difference between: Height - Gets or sets the suggested height of the element. ActualHeight - Gets the rendered height of this element. ( readonly ) ExtentHeight - Gets a value that contains the vertical size of the extent. ( readonly ) ViewportHeight - Gets a value that contains the vertical size of the content's viewport. ( readonly ) DesiredSize - Gets the size that this element computed during the measure pass of the

Stackpanel: Height vs ActualHeight vs ExtentHeight vs ViewportHeight vs DesiredSize vs RenderSize

為{幸葍}努か 提交于 2020-01-11 15:46:22
问题 i want to know the height of all items my StackPanel . What is the difference between: Height - Gets or sets the suggested height of the element. ActualHeight - Gets the rendered height of this element. ( readonly ) ExtentHeight - Gets a value that contains the vertical size of the extent. ( readonly ) ViewportHeight - Gets a value that contains the vertical size of the content's viewport. ( readonly ) DesiredSize - Gets the size that this element computed during the measure pass of the

Libgdx camera/scaling issue

爷,独闯天下 提交于 2020-01-11 12:51:30
问题 This is just a really quick post wondering what i have done wrong? I want the background to be filled on the whole screen with whatever screen sizes i have but this does not make it work. Here is all the code: // Variables Jump game; OrthographicCamera cam; SpriteBatch sb; // Variables public SplashScreen(Jump game) { this.game = game; cam = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.translate(cam.viewportWidth / 2, cam.viewportHeight / 2); sb = new

Libgdx camera/scaling issue

隐身守侯 提交于 2020-01-11 12:50:31
问题 This is just a really quick post wondering what i have done wrong? I want the background to be filled on the whole screen with whatever screen sizes i have but this does not make it work. Here is all the code: // Variables Jump game; OrthographicCamera cam; SpriteBatch sb; // Variables public SplashScreen(Jump game) { this.game = game; cam = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.translate(cam.viewportWidth / 2, cam.viewportHeight / 2); sb = new

Gems/Services for autoscaling Heroku's dynos and workers

我的梦境 提交于 2020-01-09 12:51:16
问题 I want to know if there are any good solutions for autoscaling dynos AND workers on Heroku in a production environment (probably a different solution for each of those, as they are pretty unrelated). What are you/companies using, regarding this? I found lots of options, but none of them seem really mature for a production environment. There is Heroscale, which seem to introduce some latency as it does not run locally, and I also heard of some downtime. There are modifications of delayed_jobs,

transform:scale vs traditional resizing

痞子三分冷 提交于 2020-01-06 13:42:23
问题 Are there any drawbacks of using transform: scale(x.x) instead of doing traditional resizing with the width and height properties? Does scaling produce a lower quality image or something? 回答1: Scale generates a general better quality result (from a visual point of view) because many browsers render it via GPU (in other words, with hardware acceleration) using advanced resampling algotithms, but it has a drawback: Scaled object does not create a space around it, larger than its original size .