image-scaling

Is there a way to load image as bitmap to Glide

扶醉桌前 提交于 2019-11-26 19:43:21
问题 Im looking for a way to use bitmap as input to Glide. I am even not sure if its possible. It's for resizing purposes. Glide has a good image enhancement with scale. The problem is that I have resources as bitmap already loaded to memory. The only solution I could find is to store images to temporary file and reload them back to Glide as inputStream/file.. Is there a better way to achieve that ? Please before answering .. Im not talking about output from Glide.. .asBitmap().get() I know that.I

Scaling an Image in GWT

倖福魔咒の 提交于 2019-11-26 16:33:18
问题 Changing the size of an Image Widget in GWT changes the size of the image element, but does not rescale the image on the screen. Therefore, the following will not work: Image image = new Image(myImageResource); image.setHeight(newHeight); image.setWidth(newWidth); image.setPixelSize(newWidth, newHeight); This is because GWT implements its Image widget by setting the background-image of the HTML <img... /> element as the image, using CSS. How does one get the actual image to resize? 回答1: I saw

Resizing an image in asp.net without losing the image quality

拈花ヽ惹草 提交于 2019-11-26 15:16:44
I am developing an ASP.NET 3.5 web application in which I am allowing my users to upload either jpeg,gif,bmp or png images. If the uploaded image dimensions are greater then 103 x 32 the I want to resize the uploaded image to 103 x 32. I have read some blog posts and articles, and have also tried some of the code samples but nothing seems to work right. Has anyone succeed in doing this? Alxandr I had the same problem a while back and dealt with it this way: private Image RezizeImage(Image img, int maxWidth, int maxHeight) { if(img.Height < maxHeight && img.Width < maxWidth) return img; using

Image scaling (KeepAspectRatioByExpanding) through OpenGL

烂漫一生 提交于 2019-11-26 11:23:39
问题 I\'m trying to implement image scaling in OpenGL using only glTexCoord2f() and glVertex2f() . Let me explain: after loading a QImage and sending it to the gpu with glTexImage2D() I have to perform image scaling operations based on Qt\'s specification . Qt defines these 3 operations (see image below): I think this is the only way to do it since my application is a Qt plugin and this task needs to be done inside the paint() method of the class. The IgnoreAspectRatio operation is pretty straight

Blackberry - how to resize image?

匆匆过客 提交于 2019-11-26 11:03:40
问题 I wanted to know if we can resize an image. Suppose if we want to draw an image of 200x200 actual size with a size of 100 x 100 size on our blackberry screen. Thanks 回答1: Just an alternative: BlackBerry - draw image on the screen BlackBerry - image 3D transform 回答2: You can do this pretty simply using the EncodedImage.scaleImage32() method. You'll need to provide it with the factors by which you want to scale the width and height (as a Fixed32). Here's some sample code which determines the

Resizing an image in asp.net without losing the image quality

余生长醉 提交于 2019-11-26 05:58:20
问题 I am developing an ASP.NET 3.5 web application in which I am allowing my users to upload either jpeg,gif,bmp or png images. If the uploaded image dimensions are greater then 103 x 32 the I want to resize the uploaded image to 103 x 32. I have read some blog posts and articles, and have also tried some of the code samples but nothing seems to work right. Has anyone succeed in doing this? 回答1: I had the same problem a while back and dealt with it this way: private Image RezizeImage(Image img,

How to scale a BufferedImage

依然范特西╮ 提交于 2019-11-26 01:29:47
问题 Following the javadocs, I have tried to scale a BufferedImage without success here is my code: BufferedImage image = MatrixToImageWriter.getBufferedImage(encoded); Graphics2D grph = image.createGraphics(); grph.scale(2.0, 2.0); grph.dispose(); I can\'t understand why it is not working, any help? 回答1: AffineTransformOp offers the additional flexibility of choosing the interpolation type. BufferedImage before = getBufferedImage(encoded); int w = before.getWidth(); int h = before.getHeight();

Resizing an Image without losing any quality [closed]

删除回忆录丶 提交于 2019-11-25 23:39:37
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . How can I resize an image, with the image quality unaffected? 回答1: As rcar says, you can't without losing some quality, the best you can do in c# is: Bitmap newImage = new Bitmap(newWidth, newHeight); using

How to scale an Image in ImageView to keep the aspect ratio

*爱你&永不变心* 提交于 2019-11-25 23:09:02
问题 In Android, I defined an ImageView \'s layout_width to be fill_parent (which takes up the full width of the phone). If the image I put to ImageView is bigger than the layout_width , Android will scale it, right? But what about the height? When Android scales the image, will it keep the aspect ratio? What I find out is that there is some white space at the top and bottom of the ImageView when Android scales an image which is bigger than the ImageView . Is that true? If yes, how can I eliminate