I have a WPF application that includes buttons with PNG images. The actual images get scaled by grid control inside the button to about 32 pixels or so (depending on button size). At the same time my original artwork created in Photoshop is 250x250 pixels in size.
Currently I create artwork in Photoshop, add it to my WPF project as a resource, and have WPF automatically scale it to the button size.
Here's my question - if my original image is 250x250 pixels, and WPF squeezes it into a button so that it is only 32x32 pixels, does my output file contain the 250x250 image, or the 32x32 image?
I'm asking because if the app performance is going to be negatively affected by the original image size, I'd rather just scale it in Photoshop myself.
Yes, it will include the full file, because it can't recognize that it might not be shown larger at runtime. You can check this by decompiling your program using ILSpy.
Related
I'm working on application, where small UI.Images are displayed with small textures 32x32 pixels. It is very important to display each pixel properly.
When I'm trying to launch the application in Unity everything is perfect - Image consists of 32x32 pixels.
While deployed to Hololens, the Image has worse quality and resolution changes to 16x16 pixels.
The question is how to obtain texture displayed in 32x32 pixels quality on Hololens device?
Ok, finally I figured it out. In Unity Edit > Project Settings > Quality the option Very Low is used for Hololens application. In this mode the Texture Quality is set to Half Res, thus the Image was rendered with half of the pixels' number (16 pixels). When changed to Full Res, the Image get original 32 pixels size.
It does not explain why in Unity Editor the Image was displayed properly, but the most important thing is that now it's working properly on the device.
I have a problem where my icon doesn't scale to fit when I zoom in on it when it's on my desktop.
Followed by when I zoom in.
How can I make sure the image for my program scales as well?
It does scale down, but it stops scaling up after it gets to its default size.
I'm using Visual Studio and my software is done in C# WPF.
This has nothing to do with code. Your *.ico File is missing the supported images.
The *.ico icons can have different images for multiple sizes, eg. 16x16, 32x32, 48x48, 128x128, 256x256.
There is this question on SuperUser how to embed them.
I am writing a UWP app that includes an "unplated" icon at the 32x32 size (file name Square44x44Logo.targetsize-32_altform-unplated.png). I also have the same icon at the 24x24 size (file name Square44x44Logo.targetsize-24_altform-unplated.png). I also have the same two sizes in non-"unplated" variants. However, when I build and run my app, the icon used in the taskbar (and only the taskbar) is of an incorrect size. The 24x24 icon is used, instead of the 32x32 icon, resulting in the icon appearing visibly smaller than the others in the taskbar. See picture below.
I have followed the advice in this question, to no effect.
The 24x24 icon is used, instead of the 32x32 icon, resulting in the icon appearing visibly smaller than the others in the taskbar.
Your icon looks smaller than others might because it's rectangle. It has fewer number of pixels on the vertical, showing it in a "unplated" fashion would make it "looks" smaller.
Below is a screenshot of the zoomed image, it shows that your icon has the same width with another two icons.
In this case, I suggest you using the “plated” icon to see if your icon is the same size of others.
Windows 10 introduces an evolution of the existing scaling model. In addition to scaling vector content, there is a unified set of scale factors that provides a consistent size for UI elements across a variety of screen sizes and display resolutions.
For more information, see to Guidelines for tile and icon assets.
I am working on a CMS like project which users can upload images with contents. I have to create thumbnails for the uploaded images on the fly. Lets say the thumbnail size as 125x75
I can resize images without problem but when it comes to crop operation several problems occur. My resize and crop procedure works like this:
Load the original image.
Resize the image to desired size preventing the original aspect ratio depending on the given maximum width or height
If the result image has a different aspect ration than the output aspect ratio than a centered crop operation is applied.
But what I want to achive is a content-aware cropping as described in Jue Wang's article Opticrop: Content-aware Cropping with PHP and ImageMagick
Is there any way to do it with C# or is there a library that can do this operation.
Note: I do not want content-aware resizing. Content-aware resizing (seam craving) can be done with ImageResizing.net SeamCarving plugin
If you are using the ImageResizing.net framework, the WhitespaceTrimmer plugin may be a good starting point I think.
If you want to write the code yourself, this Gist shows a good solution using entropy but is written in Ruby.
I created an icon with two different image sizes in it:
one 16x16 with 24bpp
one 32x32 with 24bpp
using the icon editor in Visual Studio.
I had hoped that when used by a form (the Form's Icon-propery) I would see the 16x16 version in its upper left corner and the 32x32 version on the task bar. Unfortunately, the 16x16 version is used in the task bar as well.
So my question is simply: how can I persuade Windows to make a "better" choice between the differnt sizes in my icon file?
Import the different sized images into Gimp as layers. Make sure the larger icon is the top layer. Then you can export as .ICO and Gimp will make one file containing multiple icons.
Change the order of the image in .ico file: Biggest -> Smallest.
To have the best quality of an icon for any use, I will create the largest size. This size is 256*256. It will help you to have a better quality, except smaller size that the windows won't manage them as unique, So try to create 256' , 32' and 16' separately as images and combine them as .ico file.