image-scaling

JavaFX : Image getting scaled to 25% and then getting printed.

旧时模样 提交于 2019-11-28 06:46:02
问题 I am trying to print an image using JavaFX api's. Unfortunately, it is cutting a part of the image, approximately 25% and then stretching that to the entire A4 page, and printing it. What am I doing wrong with the print code. How can I instruct to fit the image to page for printing, no matter what the printer is. Kindly let me know. Code : public void printThis() { System.out.println("I was called"); // note you can use overloaded forms of the Image constructor // if you want to scale, etc

Is there a way to load image as bitmap to Glide

孤街浪徒 提交于 2019-11-27 19:23:15
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 need help with input. Here is my workaround solution: Bitmap bitmapNew=null; try { // ContextWrapper

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

爷,独闯天下 提交于 2019-11-27 17:25:54
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 added android:adjustViewBounds="true" Same effect, no good. I added android:scaleType="centerInside"

Java - I need a very fast image scaling algorithm

删除回忆录丶 提交于 2019-11-27 14:16:40
问题 I am working on a Midlet application. I am finding myself in the need to scale images very often. This has become a problem because some phones are pretty slow and scaling takes too long. Currently I'm using Image.createRGBImage(int, int, int, boolean) to scale the image. I was wondering if any of you knew of a very efficient and fast way to scale an image. Note: this is a Midlet application so only JavaME is available, meaning I don't have access to some other libraries available in the full

How can I transform XY coordinates and height/width on a scaled image to an original sized image?

半腔热情 提交于 2019-11-27 14:00:17
问题 Related Question I am trying to do the same thing as in the linked question, but with C#. I am showing a scaled image and am allowing a user to select an area to crop. However, I can't just take the x1y1, x2y2 coordinates from the scaled image selection and crop that from the original. I've tried doing some basic math like in the other question, but that's obviously not the right approach either (it's definitely closer). Edit Original Image Dimensions: w = 1024 h = 768 Scaled Image Dimensions

Scaling an Image in GWT

感情迁移 提交于 2019-11-27 13:57:30
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? Daniel I saw this blog entry , which solves the problem by using a GWT DataResource instead of ImageResource. It

Image scaling (KeepAspectRatioByExpanding) through OpenGL

寵の児 提交于 2019-11-27 04:49:11
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 forward and it's working right now. The KeepAspectRatio gave me some trouble initially but now it's also

Scale an image nicely in Delphi?

独自空忆成欢 提交于 2019-11-27 04:19:53
问题 I'm using Delphi 2009 and I'd like to scale an image to fit the available space. the image is always displayed smaller than the original. the problem is TImage Stretch property doesn't do a nice job and harms the picture's readability. (source: xrw.bc.ca) I'd like to see it scaled like this instead: (source: xrw.bc.ca) Any suggestions how best to do this? Tried JVCL, but it doesn't seem to have this ability. A free library would be nice but maybe there's a low cost library that does "only"

Blackberry - how to resize image?

守給你的承諾、 提交于 2019-11-27 04:08:07
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 Maksym Gontar Just an alternative: BlackBerry - draw image on the screen BlackBerry - image 3D transform 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 scale factor for the width and height by dividing the original image size by the desired size, using

Image scaling and rotating in C/C++

爱⌒轻易说出口 提交于 2019-11-27 01:37:50
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 pixels being duplicated. So, what's the best way to accomplish this? Next, I would like to be able to