scaling

Scaling from the center in flash

耗尽温柔 提交于 2019-12-07 09:20:08
问题 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. 回答1: 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 +=

How to properly enable dpi-scaling on uwp app

你离开我真会死。 提交于 2019-12-07 09:05:50
问题 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

Scaling pixel art with Qt Quick

喜欢而已 提交于 2019-12-07 08:41:06
问题 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(

Using tomcat in round robin mode

核能气质少年 提交于 2019-12-07 08:00:31
问题 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

android layout at different screen sizes

孤街浪徒 提交于 2019-12-07 05:00:19
问题 trying to get my head around screen sizes so my app looks the same on different devices. I have two devices a galaxy s3 and a galaxy tab 8. both have the same resolution screen 720 x 1280 but the s3 is 4.7 inches while the tab is 8 inches When I do a linear layout I set padding to 130 at the top so that the first textview is 130 pixels from the top so the image on the background is not obscured. This is fine on the s3 but when I load it on the tab the padding needs changing to 190 pixels for

Unity-3d-5 Scale images for 16:9 to other resolutions

落花浮王杯 提交于 2019-12-07 04:56:59
问题 So I created a snake game with a border created with 2d sprites. I have my game window set to 16:9, when in this resolution the images look fine. However, scaling to anything else begins to make the game look weird. I want the game window to be re-sizable. How can I make my sprites stretch and shrink based on the current resolution? I have already tried creating a sprite that is 120 in Width and 1 in Height, then using the x,y,z scales to change the scale to 16. This produced a huge sprite. I

Render large CATiledLayer into smaller area

余生颓废 提交于 2019-12-06 21:52:31
I have a CATiledLayer of size 4096 x 4096 which I want to render into a PNG of size 1024 x 1024 this isnt doing it... -(NSData *)createPNGFormat { UIGraphicsBeginImageContext(CGSizeMake(1024, 1024)); tiledLayer.transform = CATransform3DMakeScale(0.25, 0.25, 1.0); [tiledLayer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return UIImagePNGRepresentation(image); } Any ideas on how to do this? [First Hack] Brute Force , Render tile by tile. This works (slowly) -(UIImage *)renderTileX:(NSInteger)xpos tileY:

UIWebView scaling page so that there is no need for horizontal scrolling

匆匆过客 提交于 2019-12-06 15:12:04
问题 Is there a way to scale a web page in a UIWebView that maintains the aspect ratio but alleviates the need to scroll horizontally to read an article, for example. Vertical scrolling is fine, I just don't want the user to have to constantly be scrolling back and forth horizontally to read each line of the article. Thanks! Edit: the code I'm using to create the view _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, [[self view] frame].size.width, [[self view] frame].size.height)]; [

OpenGL ES Pixel Art - Scaling

和自甴很熟 提交于 2019-12-06 14:56:04
Im having trouble displaying pixel based art (think retro tiles and art) on OpenGL Es 1.1 on the iPhones. Tiles are represented using 8bytes (1 byte for each row) with each bit representing a pixel being set or not. For example a tile with the number 8: 0 0 0 0 0 0 0 0 -> 0 0 1 1 1 0 0 0 -> xxx 0 1 0 0 0 1 0 0 -> x x 0 1 0 0 0 1 0 0 -> x x 0 0 1 1 1 0 0 0 -> xxx 0 1 0 0 0 1 0 0 -> x x 0 1 0 0 0 1 0 0 -> x x 0 0 1 1 1 0 0 0 -> xxx Converting this to OpenGL on iPhone using glDrawArrays(GL_POINTS, 0, 64); The logic is correct, but the problem is it doesn't give the retro effect. I was looking for

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

筅森魡賤 提交于 2019-12-06 14:11:20
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(); CGContextSaveGState(context); CGRect rect = CGPDFPageGetBoxRect(page, kCGPDFCropBox); float widthFactor = width/