image-scaling

How can I crop/scale user images so I can display fixed sized thumbnails without skewing and stretching?

余生颓废 提交于 2019-12-24 00:35:05
问题 I'm working on allowing users to upload profile pictures for my site. The classic example of what I'm trying to avoid is plentyoffish.com where each users image is skewed and looks very ugly: So, how can I progmatically crop/create standard sized versions of an image without the skewing demonstrated above? 回答1: Well, you must have a maximum height and width, lets assume the image size you have available is square, say 100x100. When a user uploads an image get the dimensions of it, then work

Speed up zoom feature in ImageView

女生的网名这么多〃 提交于 2019-12-23 15:36:52
问题 I'm currently dealing with really big images (7-10mb) that cannot be resized or compressed for multiple reasons. Now, the idea is to show them in a custom ImageView that enables the user to do the double-tap zoom, pinch to zoom, etc. I used this library for the job: https://github.com/MikeOrtiz/TouchImageView I've tried also other libraries but every other library is still really slow. Can someone give me some pointers/suggestion to make it faster (even writing my own C++ implentation)? I'm a

Rescale image so width is half the size of screen

*爱你&永不变心* 提交于 2019-12-23 04:12:31
问题 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

How to make the image scale its size automatically according to the parent JLabel's size, in Netbeans GUI Builder?

♀尐吖头ヾ 提交于 2019-12-20 03:16:56
问题 BACKGROUND:- I am required to make a Swing GUI using Netbeans GUI Builder. The first sub-task is to display an image in the entire background. I have followed a tutorial to get that done. I have basically made a JFrame, set its layout to GridBagLayout and then added a transparent (by unchecking the opaque property) JPanel to it. (Question 1) After that I added a JLabel to the JFrame, Removed its text and added an image to it. (Question 2) QUESTIONS:- First, when I add the JPanel, it does not

Scale a BufferedImage the fastest and easiest way

老子叫甜甜 提交于 2019-12-18 11:49:49
问题 The task: I have some images, I scale them down, and join them to one image. But I have a little problem with the implementation: The concrete problem: I want to resize/scale a BufferedImage. The getScaledInstance method returns an Image object, but I can't cast it to BufferedImage: Exception in thread "main" java.lang.ClassCastException: sun.awt.image.ToolkitImage cannot be cast to java.awt.image.BufferedImage (I don't know why is it a ToolkitImage instead of an Image...) I found a solution:

dynamically scale images in php jpg/png/gif

蓝咒 提交于 2019-12-18 05:13:06
问题 Is there a simple way of dynamically scaling an image in php? Id like to specifically use some kind of function where i can insert it into my heml such as <img src=image.php?img=boss.jpg&width=500> and of course it would then scale the image to whatever height constrains it to 500px wide i appreciate all input, thanks. EDIT does need to include jpg png and gif file types 回答1: I prefer WideImage library, because it's really really easy to use. In your case, everything you have to do is: $img

Android ImageView scale smaller image to width with flexible height without cropping or distortion

删除回忆录丶 提交于 2019-12-17 15:14:28
问题 Often asked, never answered (at least not in a reproducible way). I have an image view with an image that is smaller than the view. I want to scale the image to the width of the screen and adjust the height of the ImageView to reflect the proportionally correct height of the image. <ImageView android:layout_width="fill_parent" android:layout_height="wrap_content" /> This results in the image centered at its original size (smaller then the screen width) with margins at the side. No good. So I

Image scaling and rotating in C/C++

别说谁变了你拦得住时间么 提交于 2019-12-17 06:45:25
问题 What is the best way to scale a 2D image array? For instance, suppose I have an image of 1024 x 2048 bytes, with each byte being a pixel. Each pixel is a grayscale level from 0 to 255. I would like to be able to scale this image by an arbitrary factor and get a new image. So, if I scale the image by a factor of 0.68, I should get a new image of size 0.68*1024 x 0.68*2048. some pixels will be collapsed onto each other. And, if I scale by a factor of say 3.15, I would get a larger image with

Crop to fit an svg pattern

有些话、适合烂在心里 提交于 2019-12-17 06:38:32
问题 I have patterns that each have a single image in them. I need the images to scale to the full width or height of their containers, which are paths, while retaining their proportions. Essentially, they need to behave like an html image might if you set min-width:100%; min-height:100%; I have not used svgs much before and do not know which attributes to change to get this type of behaviour. I've been trying all sorts of combinations of viewBox , preserveAspectRatio , patternUnits and more, but

High Quality Image Scaling Library [closed]

只愿长相守 提交于 2019-12-16 20:04:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I want to scale an image in C# with quality level as good as Photoshop does. Is there any C# image processing library available to do this thing? 回答1: Here's a nicely commented Image Manipulation helper class that you can look at and use. I wrote it as an example of how to perform certain image manipulation