image-scaling

Preventing SVG background image from scaling

巧了我就是萌 提交于 2019-12-07 20:45:16
问题 I'm using SVG elements with masks to "knock out" or "punch out" text so that the underlying image can be shown through. The only problem with my current set up is that when the browser window is resized, the image elements stretch and distort, rather than staying at a fixed aspect ratio/size. I've been pouring over the svg spec and have read about preserveAspectRatio but nothing seems to work. Here's the basic element I'm using: <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100

Creating memory efficient thumbnails using an NSImageView (cocoa/OSX)

混江龙づ霸主 提交于 2019-12-07 20:01:45
问题 I am creating small NSImageViews (32x32 pixels) from large images often 512x512 or even 4096 x 2048 for an extreme test case. My problem is that with my extreme test case, my applicaiton memory footprint seems to go up by over 15MB when I display my thumbnail, this makes me think the NSImage is being stored in memory as a 4096x2048 instead of 32x32 and I was wondering if there is a way to avoid this. Here is the process I go through to create the NsImageView: • First I create an NSImage using

Rescale image so width is half the size of screen

折月煮酒 提交于 2019-12-06 16:20:58
I'm fairly new to swift and I'm currently trying to display multiple image views within a custom UITableCell. Ideally, I would like to have each image be scaled so that its width fills half of the screen size (while preserving the original aspect ratio). The idea is that each UITableCell will have a collage of 3 images and some additional information in a UILabel -- the tallest image would sit in its own column with the smaller two stacked right next to the tallest. Below is a screenshot to help illustrate what I'm trying to achieve: However, I'm having some trouble with this. Currently, once

Preventing SVG background image from scaling

最后都变了- 提交于 2019-12-06 08:20:42
I'm using SVG elements with masks to "knock out" or "punch out" text so that the underlying image can be shown through. The only problem with my current set up is that when the browser window is resized, the image elements stretch and distort, rather than staying at a fixed aspect ratio/size. I've been pouring over the svg spec and have read about preserveAspectRatio but nothing seems to work. Here's the basic element I'm using: <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <mask id="masktext1"> <rect width="100%" height=

Scale large images using Java and AsyncScalr

烈酒焚心 提交于 2019-12-06 08:20:02
I'm using AsyncScalr in a Servlet to scale down some large images (~ 10-15 MegaBytes), the actual resizing process takes about 40ms which is not much. The overkill comes from Reading the Image from Local Storage as a BufferedImage. so the times are mostly like : read the image file : 1630ms !! resizing the image : 41ms writing the image : 40ms below is the code that I'm using, is there any more optimal way to do this? final FileImageInputStream fileImageInputStream = new FileImageInputStream(file); BufferedImage bufferedImage = ImageIO.read(fileImageInputStream); // resize file Future

Creating memory efficient thumbnails using an NSImageView (cocoa/OSX)

余生长醉 提交于 2019-12-06 07:28:17
I am creating small NSImageViews (32x32 pixels) from large images often 512x512 or even 4096 x 2048 for an extreme test case. My problem is that with my extreme test case, my applicaiton memory footprint seems to go up by over 15MB when I display my thumbnail, this makes me think the NSImage is being stored in memory as a 4096x2048 instead of 32x32 and I was wondering if there is a way to avoid this. Here is the process I go through to create the NsImageView: • First I create an NSImage using initByReferencingFile: (pointing to the 4096x2048 .png file) • Next I initialize the NSImageView with

App size is too big because of too many images

谁说胖子不能爱 提交于 2019-12-05 01:30:57
问题 I'm creating an universal app. For one screen, I'm displaying 6 images (png format) in a grid using this control. Also this screen supports both portrait and landscape orientation. I've created a set of images in different resolutions for all the iDevices and named them using the correct naming convention as follows. name~iphone.png name@2x~iphone.png name~ipad.png name@2x~ipad.png name-568h@2x~iphone.png (iPhone 5) And I had to create another set of these images since I support both

How to fix pinch zoom focal point in a custom view?

断了今生、忘了曾经 提交于 2019-12-04 21:59:39
问题 For my question I have prepared a very simple test app at Github. For simplicity I have removed flinging, scroll constraints and edge effects (which actually work well in my real app): So the custom view in my test app only supports scrolling: mGestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() { @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float dX, float dY) { mBoardScrollX -= dX; mBoardScrollY -= dY; ViewCompat

Excel VBA Image EXIF Orientation

穿精又带淫゛_ 提交于 2019-12-04 18:07:54
问题 Made this macro that inserts images from the active directory into an excel spreadsheet and scales it down to fit in the cell. It works pretty well except for images that come from a source were their orientation/rotation is defined in the EXIF data. So in: In Windows Explorer - Not rotated Window Picture viewer - Not rotated IE - Not Rotated Chrome - Rotated EXCEL - Rotated It's all due to some legacy issue from the camera that the image was taken from. Somebody post a similar problem but it

How to resize dynamically loaded image into flash (as3)

妖精的绣舞 提交于 2019-12-03 21:10:13
问题 Am struggling to find the right as3 code to resize an image once it is dynamically called into the stage and placed in a MC. I am loading using: var myLoader :Loader = new Loader(); mc.addChild(myLoader); var url :URLRequest = new URLRequest("myimage.jpg"); myLoader .load(url ); The stage will eventually open up into fullscreen (works ok) so I need to keep the image in its original size which is much bigger than the stage. What I need to do is shrink it on loading to the same height as the