Resize PNG image

The original author of the PNGImage component (the basis of the Delphi native component) had a forum where he, and others, posted code snippets on how to do things using the PNGImage component. Before the forum was taken down I grabbed a copy of all of the code snippets and placed them on the CodeGear … Read more

Win32: My Application freezes while the user resizes the window

There are a number of modal operations that happen on windows. Win32 Modal operations refer to functions that put an application into a “mode” by starting their own event processing loop until the mode finishes. Common application modes include drag and drop operations, move/size operations, anytime a dialog pops up that needs input before the … Read more

Custom CSS to allow chrome textarea resize smaller than initial state?

These “min-height/min-width” rely on cols and rows attributes. Eg. if cols is missing or less than 1, its default value is 20, so the minimum width will be 20 characters width. (cf. http://www.w3.org/TR/html5/forms.html#the-textarea-element) The fact you cannot resize a textarea under its initial dimensions is reported as a bug (https://code.google.com/p/chromium/issues/detail?id=94583) although The user agent may … Read more

How to resize a bitmap eficiently and with out losing quality in android

Resizing a Bitmap: public Bitmap getResizedBitmap(Bitmap bm, int newHeight, int newWidth) { int width = bm.getWidth(); int height = bm.getHeight(); float scaleWidth = ((float) newWidth) / width; float scaleHeight = ((float) newHeight) / height; // create a matrix for the manipulation Matrix matrix = new Matrix(); // resize the bit map matrix.postScale(scaleWidth, scaleHeight); // recreate … Read more

How to zoom an image in&out in C#?

One solution is: Create new image of the desired size (for example 200% or 50% of original image size) Draw original image to new image using Graphics.DrawImage(Image, Rectangle);, which draws the given image to the new image at the given position with the given size Set new image as source for the PictureBox Another way … Read more

How can I change the size of an array in C?

You can’t. This is normally done with dynamic memory allocation. // Like “ENEMY enemies[100]”, but from the heap ENEMY* enemies = malloc(100 * sizeof(ENEMY)); if (!enemies) { error handling } // You can index pointers just like arrays. enemies[0] = CreateEnemy(); // Make the array bigger ENEMY* more_enemies = realloc(enemies, 200 * sizeof(ENEMY)); if (!more_enemies) … Read more

Window resize directive

I think you forgot to fire digest cycle by calling scope.$apply(); at the end of scope.onResize method Anyways, I used following directive (took from HERE) that works for me: Try to open debug view and change view height: Demo Fiddle app.directive(‘resize’, function ($window) { return function (scope, element, attr) { var w = angular.element($window); scope.$watch(function … Read more