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
386
votes
9 answers

How can I make an SVG scale with its parent container?

I want to have an inline SVG element's contents scale when size is non-native. Of course I could have it as a separate file and scale it like that. index.html: foo.svg:
bjb568
  • 11,089
  • 11
  • 50
  • 71
344
votes
7 answers

Android and setting width and height programmatically in dp units

I'm doing: button.setLayoutParams(new GridView.LayoutParams(65, 65)); According to the docs the units for the width and height (both 65 in the above) are "pixels". How do you force this to be device independent pixels, or "dp"?
Ken
  • 30,811
  • 34
  • 116
  • 155
269
votes
8 answers

How to scale down a range of numbers with a known min and max value

So I am trying to figure out how to take a range of numbers and scale the values down to fit a range. The reason for wanting to do this is that I am trying to draw ellipses in a java swing jpanel. I want the height and width of each ellipse to be…
user650271
  • 2,853
  • 3
  • 17
  • 8
214
votes
5 answers

What does the filter parameter to createScaledBitmap do?

The declaration of android.graphics.Bitmap.createScaledBitmap is public static Bitmap createScaledBitmap (Bitmap src, int dstWidth, int dstHeight, boolean filter) However, the documentation doesn't explain any of the parameters. All of them are…
clahey
  • 4,795
  • 3
  • 27
  • 20
170
votes
3 answers

What's the difference between CENTER_INSIDE and FIT_CENTER scale types?

I can't tell the difference between ImageView.ScaleType.CENTER_INSIDE and ImageView.ScaleType.FIT_CENTER. CENTER_INSIDE Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be…
Keith
  • 2,958
  • 4
  • 26
  • 29
161
votes
9 answers

Can anyone explain me StandardScaler?

I am unable to understand the page of the StandardScaler in the documentation of sklearn. Can anyone explain this to me in simple terms?
nitinvijay23
  • 1,781
  • 3
  • 13
  • 11
131
votes
22 answers

Android Webview - Webpage should fit the device screen

I have tried the following to fit the webpage based on the device screen size. mWebview.setInitialScale(30); and then set the metadata viewport
SWDeveloper
  • 1,749
  • 5
  • 18
  • 20
123
votes
2 answers

Android imageview not respecting maxWidth?

So, I have an imageview that should display an arbitrary image, a profile picture downloaded from the internet. I want this the ImageView to scale its image to fit inside the height of the parent container, and a set max width of 60dip. However, if…
juell
  • 4,930
  • 4
  • 18
  • 19
112
votes
10 answers

Why isn't my vector drawable scaling as expected?

I am attempting to use vector drawables in my Android app. From http://developer.android.com/training/material/drawables.html (emphasis mine): In Android 5.0 (API Level 21) and above, you can define vector drawables, which scale without losing…
Chris Knight
  • 24,333
  • 24
  • 88
  • 134
102
votes
1 answer

How to scale SVG image to fill browser window?

This seems like it ought to be easy, but I'm just not getting something. I want to make an HTML page containing a single SVG image that automatically scales to fit the browser window, without any scrolling and while preserving its aspect ratio. For…
Miral
  • 12,637
  • 4
  • 53
  • 93
86
votes
9 answers

Scaling solutions for MySQL (Replication, Clustering)

At the startup I'm working at we are now considering scaling solutions for our database. Things get somewhat confusing (for me at least) with MySQL, which has the MySQL cluster, replication and MySQL cluster replication (from ver. 5.1.6), which is…
Eran Galperin
  • 86,251
  • 24
  • 115
  • 132
80
votes
13 answers

Scaled Bitmap maintaining aspect ratio

I would like to scale a Bitmap to a runtime dependant width and height, where the aspect ratio is maintained and the Bitmap fills the entire width and centers the image vertically, either cropping the excess or filling in the gap with 0 alpha…
RileyE
  • 10,874
  • 13
  • 63
  • 106
76
votes
9 answers

How to scale down a UIImage and make it crispy / sharp at the same time instead of blurry?

I need to scale down an image, but in a sharp way. In Photoshop for example there are the image size reduction options "Bicubic Smoother" (blurry) and "Bicubic Sharper". Is this image downscaling algorithm open sourced or documented somewhere or…
Proud Member
  • 40,078
  • 47
  • 146
  • 231
76
votes
8 answers

Chrome, Safari ignoring max-width in table

I've got HTML code like this:
GaGar1n
  • 1,040
  • 2
  • 10
  • 17
75
votes
5 answers

How do I scale one rectangle to the maximum size possible within another rectangle?

I have a source rectangle and a destination rectangle. I need to find the maximum scale to which the source can be scaled while fitting within the destination rectangle and maintaining its original aspect ratio. Google found one way to do it but I'm…
Agnel Kurian
  • 57,975
  • 43
  • 146
  • 217
1
2 3
99 100