Questions tagged [scaling]

Scaling refers to the image manipulation function of re-sizing an image. For issues to do with handling increasing workload gracefully in software or network components, see "scalabilty".

Scaling refers to the image manipulation function of re-sizing an image.

2497 questions
16
votes
0 answers

Scale bitmap keeping aspect ratio in layer-list

I'm trying to create a background drawable made of a gradient that fills the entire view and a pattern with left gravity that resizes to fit vertically while keeping its aspect ratio. This is what I currently have:
zebasz
  • 788
  • 7
  • 14
15
votes
2 answers

React Native max value for font scaling

I'm aware that I can disable font scaling globally in my React Native app by putting Text.defaultProps.allowFontScaling = false in the constructor of the root component (i.e. in the root index.js or App.js file). However, is there a way to allow a…
Attila
  • 1,097
  • 2
  • 19
  • 45
15
votes
2 answers

Scaling flexdashboard gauge in R

I'm trying to use flexdashboard::gauge, but it is always the same size(doesn't scale) and I don't know how to change it's size. I know there is a way to do this for normal plots using renderPlot and setting for example height. Is there a way to do…
user38129
  • 161
  • 1
  • 4
15
votes
5 answers

Why does this Java code not utilize all CPU cores?

The attached simple Java code should load all available cpu core when starting it with the right parameters. So for instance, you start it with java VMTest 8 int 0 and it will start 8 threads that do nothing else than looping and adding 2 to an…
ReneS
  • 3,535
  • 2
  • 26
  • 35
15
votes
5 answers

Resizing a bitmap to a fixed value but without changing the aspect ratio

I'm looking for a solution for the following problem: how to change the size of a Bitmapto a fixed size (for example 512x128). The aspect ratio of the bitmap content must be preserved. I think it should be something like this: create an empty…
Dark.Rider
  • 381
  • 1
  • 4
  • 17
14
votes
6 answers

How do I prevent scaling in Android Imageview?

I have an image that is 480 pixels by 40 pixels. I would like to show this image in an ImageView without having it scale to fit. Ex: If my screen is only 320pixels wide I would like only 320pixels of the image to show on the screen, not have it cram…
PaulG
  • 6,920
  • 12
  • 54
  • 98
14
votes
1 answer

How can I programmatically set adjustViewBounds to true in Android?

I want to set adjustViewBounds property of my ImageView to true, programmatically, not in XML. How can this be done?
Fanria
  • 141
  • 1
  • 1
  • 3
14
votes
1 answer

how to scale an image in an ImageView so that it "fits"

I want to scale an image in an ImageView in the following way. The ImageView has some dimensions Width (W) and Height (H). The image I'm putting into the image view could be smaller or bigger than WxH. I want it to scale while preserving aspect…
user645402
  • 737
  • 1
  • 16
  • 34
14
votes
5 answers

Convert numbers within a range to numbers within another range

Possible Duplicate: Convert a number range to another range, maintaining ratio So I have a function that returns values within 0 and 255 and I need to convert these values to something between -255 and 255 So 200 would be roughly 145, 150 would…
Perbert
  • 465
  • 1
  • 7
  • 17
14
votes
3 answers

Scale a list of numbers from -1.0 to 1.0

This should be an easy one. I have a list of numbers. How do I scale list's values, between -1.0 and 1.0 in order for min = -1 and max = 1.0?
Johnny
  • 183
  • 1
  • 1
  • 5
14
votes
4 answers

UIImageView scaling/interpolation

I have a small IPhone app that I am working on and I am displaying an image with a UIImageView. I am scaling it up using the Aspect Fit mode. I would like to have the image scale up with no interpolation/smoothing (I want it to look pixellated). …
Dolphin
  • 4,655
  • 1
  • 30
  • 25
14
votes
4 answers

Gnuplot minimum and maximum boundaries for autoscaling

How can I limit the autoscaling of gnuplot, so that, as example for the y-max, it is at least a certain value and it would autoscale up to fixed "limit"? From looking at the documentation, I only see how to fix min-, or max- end of the axis, while…
varesa
  • 2,399
  • 7
  • 26
  • 45
13
votes
3 answers

Querying sharded data in MySQL

I'm dealing with a lot of data in a MySQL database and I'd like to use sharding to scale out. I understand the principles of sharding, and I even know how I want to shard my data. When I look up database sharding, I cannot find any comprehensive…
Tucker
  • 7,017
  • 9
  • 37
  • 55
13
votes
1 answer

Scaling an SVG in Java

I'm attempting to scale an image, modify it, and then output to another image format. So far, I've been using the apache batik library. For simple conversion, this is easy. For clipping the svg, this is easy. However, I can't seem to figure out how…
Stefan Kendall
  • 66,414
  • 68
  • 253
  • 406
13
votes
9 answers

C# Resized images have black borders

I have a problem with image scaling in .NET. I use the standard Graphics type to resize images like in this example: public static Image Scale(Image sourceImage, int destWidth, int destHeight) { Bitmap toReturn = new Bitmap(sourceImage,…
Ievgen
  • 4,261
  • 7
  • 75
  • 124