scaling

Scaling images with Java JAI

ε祈祈猫儿з 提交于 2019-12-05 23:58:08
问题 I have to scale an image with Java JAI. At the time now, I use the following code: private static RenderedOp scale(RenderedOp image, float scale) { ParameterBlock scaleParams = new ParameterBlock(); scaleParams.addSource(image); scaleParams.add(scale).add(scale).add(0.0f).add(0.0f); scaleParams.add(Interpolation.getInstance(Interpolation.INTERP_BICUBIC_2)); // Quality related hints when scaling the image RenderingHints scalingHints = new RenderingHints(RenderingHints.KEY_RENDERING,

LibGDX - How to smooth out actor drawable when scaling a Scene2d stage?

最后都变了- 提交于 2019-12-05 22:57:34
问题 This is my set-up: stage = new Stage(1280, 800, false); button = new Button(drawableUp, drawableDown); stage.add(button); this gets rendered as following: @Override public void render(float delta) { Gdx.gl.glClearColor(RED,GREEN,BLUE,ALPHA); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); stage.act(delta); stage.draw(); } The issue is that when the stage is shown on 1280x800 the button looks like that: If the stage is rescaled to e.g. 1280x736, the button drawable is scaled in the following way: Is

How to dynamically detect browser viewport change in size?

心已入冬 提交于 2019-12-05 21:07:45
I've been having problems with scaling... automatic... dynamic... adaptive.... etc... I have seen websites where as you make the window smaller eg. grab a corner and make the window smaller, fonts get bigger, things move around... I've got the moving part, I don't know how to dynamically detect the browser viewport... is that a refreshing thing or?... As you can see here, these motion things that I've used only work upon screen refresh, in particular I have a tablet, and if I visit the page in landscape, it doesn't apply; if I rotate it and then refresh, it applies. <script language=

Bad Swing UI scaling on high resolution (MS Surface)

允我心安 提交于 2019-12-05 20:20:02
问题 I'm currently working on a little Java application, that involves Swing GUIs. On my development PC everything looks fine but when I run it on my MS Surface, some icons seem to be too large for the components (or the components too small for the icons). Here's what I mean: Google research has lead me to conclude that this is due to Surface's high resolution and Win8's zooming to let some items appear a little larger. So I reset that zoom to 100% and it actually fixed the bad scaling.

Scaling from the center in flash

核能气质少年 提交于 2019-12-05 19:04:26
I am using flash (AS3) and have a dynamic movie clip that I want to scale up or down using a slider bar. I have this working very well using the scaleX and scaleY functions. The only trouble is that these scale from the left hand side of the document and I would like it to be scaled from the center Any help is appreciated. function scaleFromCenter(dis:*, sX:Number, sY:Number):void { var prevW:Number = dis.width; var prevH:Number = dis.height; dis.scaleX = sX; dis.scaleY = sY; dis.x += (prevW - dis.width) / 2; dis.y += (prevH - dis.height) / 2; } scaleFromCenter(yourMovieClip, 0.3, 0.3); .. Or

Scaling pixel art with Qt Quick

喜夏-厌秋 提交于 2019-12-05 16:29:19
I have a Qt Quick game that uses pixel art. For example: import QtQuick 2.2 import QtQuick.Controls 1.1 ApplicationWindow { id: window visible: true width: 300 height: 300 title: qsTr("PixelArt") Image { source: "http://upload.wikimedia.org/wikipedia/commons/f/f0/Pixelart-tv-iso.png" anchors.centerIn: parent } } I want to scale the art, so I increase the size: import QtQuick 2.2 import QtQuick.Controls 1.1 ApplicationWindow { id: window visible: true width: 300 height: 300 title: qsTr("PixelArt") Image { source: "http://upload.wikimedia.org/wikipedia/commons/f/f0/Pixelart-tv-iso.png" anchors

Using tomcat in round robin mode

假如想象 提交于 2019-12-05 14:28:21
I want to run my tomcat-instances in a configuration where requests are served to several tomcat-instance via round robin. I don't want to use any internal cluster manager. As far as I see if every request is served by different tomcats, an unknown sessionId would arrive at a tomcat, so it would be forced to create an new session and overwrite the old sessionId. So for every request a new session would be created. This seems to be a lot of overhead. Is my view on that things right? Is there a way to disable tomcats sessions management? Regards, Michael Basically you have two choices: 1)

How to properly enable dpi-scaling on uwp app

假装没事ソ 提交于 2019-12-05 12:34:20
I've created my first UWP app. It's a Windows 8.1 UWP app which will help with scheduling courses at my university who's current system is awful. I've been working on it with my Windows 10 desktop computer with a 1080p monitor at default system scaling (100%). I deployed a test build and installed it on my laptop. The laptop is also Windows 10 and 1080p but has a smaller screen so I have system scaling set to 125%. My problem is that instead of this higher scaling factor making my app have bigger features, it does the opposite and shrinks everything in the app. Here are two screenshots from my

Scale drawableLeft in button with text

一笑奈何 提交于 2019-12-05 05:54:58
I have a button with text and a drawable on the left. Is there any way I can make that drawable scale to it's appropriate size (fill button's height) while keeping its aspect ratio? Relevant excerpt from my layout: <Button android:text="@string/add_fav" android:id="@+id/event_fav_button" android:layout_width="match_parent" android:layout_height="40dp" android:drawableLeft="@drawable/star_yellow"/> You can resize an image on basis of the dimension of a Button, use getHeight() and getWidth() methods to get the size of the button and use following function to resize image for Button: Resizing a

Resize CGImageRef without anti-liasing

可紊 提交于 2019-12-05 01:58:28
问题 I am trying to resize a 10x10 pixel CGImageRef, captured like this: CGImageRef imageRef = CGImageCreateWithImageInRect(screenShot, CGRectMake(mouseLoc.x-5, screen_height-mouseLoc.y-5, 10, 10)); CGContextRef mainViewContentContext = CGBitmapContextCreate (NULL, maskImage.size.width, maskImage.size.height, 8, maskImage.size.height*4, colorSpace, kCGImageAlphaPremultipliedFirst); CGContextDrawImage(mainViewContentContext, NSMakeRect(0,0, maskImage.size.width, maskImage.size.height), imageRef);