C# WinForms disable DPI scaling

You’ll have bigger problems when you change the AutoScaleMode property. Increasing the DPI also changes the system font size. Necessarily so, font sizes are expressed in points, 1/72 inch. The fonts need to be bigger to get the same point size when the DPI increases and keep the text just as readable when viewed from … Read more

How do I scale a streaming bitmap in-place without reading the whole image first?

This method will read the header information from the image to determine its size, then read the image and scale it to the desired size in place without allocating memory for the full original sized image. It also uses BitmapFactory.Options.inPurgeable, which seems to be a sparsely documented but desirable option to prevent OoM exceptions when … Read more

jQuery resize to aspect ratio

Here’s a useful function that might do what you want: jQuery.fn.fitToParent = function() { this.each(function() { var width = $(this).width(); var height = $(this).height(); var parentWidth = $(this).parent().width(); var parentHeight = $(this).parent().height(); if(width/parentWidth < height/parentHeight) { newWidth = parentWidth; newHeight = newWidth/width*height; } else { newHeight = parentHeight; newWidth = newHeight/height*width; } var margin_top = … Read more

when scaling an element with css3 scale, it becomes pixelated until just after the animation is complete. I’m animating an element with a border

Okay so i think i’ve come up with a work around; essentially; don’t use “scale”. use “scale3d” and have it setup so that the largest you want the image is scale3d(1,1,1). Here is an example with the circle thing you had in there. I changed the scale to 5, because i didn’t want to put … Read more

CSS3 transform:scale in IE

IE9 supports transform: -ms-transform: scale(0.5,0.5); For other versions of IE, there’s a complex syntax. Something like this: filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod=’auto expand’, M11=1.5320888862379554, M12=-1.2855752193730787, M21=1.2855752193730796, M22=1.5320888862379558); Look here for more info.

White space around css3 scale

how transform works is: your element gets rendered your element gets transformed (moved, rotated, scaled) other elements stay where they got rendered – around the “original element” so the white space is really just the way the element was rendered in the first place. You should use width and height in CSS if you want … Read more

How can I shrink the drawable on a button?

I have found a very simple and effective XML solution that doesn’t require ImageButton Make a drawable file for your image as below and use it for android:drawableLeft <?xml version=”1.0″ encoding=”utf-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:id=”@+id/half_overlay” android:drawable=”@drawable/myDrawable” android:width=”40dp” android:height=”40dp” /> </layer-list> You can set the image size with android:width and android:height properties. This way you could … Read more