Visual Studio lower icon pixels - visual-studio

So this is how it started... I've managed to create an icon for my program in Visual Studio. The icon looked perfectly smooth in photoshop. I saved the file as .ico with using a photoshop plugin. I want the transparency so my icon was saved as 8 bit RGB. After importing the icon in my exe then this happened.

(Posted on behalf of the OP).
I've downloaded IcoFX and opened my file as 8 bit RGB png. Then I clicked: Image(from the top navigation menu) -> Create Windows Icon From Image. It detected it as Windows Vista because it's resolution is 256x256. Finally saved it and imported it in my Visual Studio project. The icon was so smooth after following this procedure!

Related

How to get images from Visual Studio Image Library in other dimensions?

I would like to use icons in my program on some buttons to save space and be more clear. I was under the impression that the Visual Studio Image Library is meant for this. However, Visual Studio 2019 Image Library only includes 16x16 images, while I also want 20x20, 24x24 and 28x28 (and maybe more), for different dpi/scale settings. Can I create these somehow? Or does Visual Studio not support dpi-aware applications with its Image Library?
I tried exporting the 16x16 svg as a 20x20 png, both with and without upscaling it first, but both resulted in a blurry image.

Windows UWP desktop app published in Visual Studio 2019 missing icons

I've developed a UWP desktop app in VS 2019 and C#, and used VS to automatically generate visual assets from a source JPG image.
This works fine in Debug and Release configurations (in particular, the proper icon appears in the taskbar), but when I generate a self-signed msixbundle and use it to install the application on my laptop and run it, images are missing from several locations, including the taskbar icon and desktop shortcuts, but appear in others, such as the start menu, search results and flash screen.
I've tried playing with the settings for the automatic generator and manually generating images and updating the manifest file, but nothing seems to work. As nearly as I can figure out, the images needed for things like the taskbar icon are being generated into the Assets folder, but they are not being included in the bundle when published.
Is there a solution/workaround for this (short of getting a more competent developer)?
Edit: A blank, gray rectangle appears when icons are missing.

How To Create an Icon for Visual Studio with just MSPaint and Visual Studio

I have been reading a lot of posts about creating icons and then assigning one of those icons in Visual Studio Project --> Properties --> Icon and Manifest. When I do this, I get a message that the icon is not valid. The primary way I have been doing this is using MSPaint.
This is when I save a 24-bit icon in MSPaint, which is mentioned in one of the posts I read. I cannot find any editing ability in the image editor of Visual Studio 2012. So, how does one create a simple icon for an application?
I know there are free converters out there. I am asking specifically if there is a way to convert using existing tools like Visual Studio, MSPaint, and so on.
Creating an icon in MSPaint works just fine. Here's how you should proceed to get it to work.
In Visual Studio
Open Resources.resx from Solution Explorer (it's in the Properties folder)
Choose Icons from DropDown Menu on the left [Ctrl+3]
Choose Add New Icon from the DropDown Menu Add Resource
Enter a name for the Icon Resource file
Right click on all the icons in the left panel - one at a time - and choose Delete Image Type
(The last icon cannot be deleted - Leave it for now)
In MSPaint or an image program of your choise (I prefer Microsoft Paint 3D)
Create/Open the image that you would like to use (It could be a screenshot of your program)
Resize the image to 256x256 pixels
Select the full image [Ctrl+A] and then copy the image [Ctrl+C]
In Visual Studio
Right click in the left panel (the icon panel) and choose New Image Type... [Ins]
Choose Target Image Type 256x256, 24 bit
(Select the New Target Type and) Paste [Ctrl+V] the image you copied from your image program
In your image program and in Visual Studio
Repeat the above Image Copy (image program) and Target Paste (Visual Studio) process for the 24 bit icon size's 128x128, 64x64, 32x32 and 16x16 (and/or the ones you like to support)
Don't forget to delete the last icon you couldn't delete before
In Visual Studio
Save the icon file (.ico) (by closing its tab or using [Ctrl+S])
Add the icon to your forms
Right click your project file in the Solution Explorer and choose Properties
(You'll also find it in the Visual Studio Menu Debug -> "Your Project Name" Properties...)
Choose the Application section
Under Resources - Icon and manifest browse to and select the icon file you just created.
All set...
(Tested with Visual Studio 2017 & Visual Studio Enterprise 2019)
When this question was posted in 2016, it made more sense to use only MSPaint and VS. But nowadays, you can just use https://icoconverter.com/
Upload your image file (PNG, GIF, JPG, etc.)
Select ICO for Windows 7, Windows 8, Vista and XP
Download the ICO file, which contains various resolutions of your original image.

Visual C++ and exe icon size

I have writed a small C++ program in Visual C++ 2012, I added a icon (contain multiple sizes and depths from 16x16 16bit to 256x256 32bit) but when compile, windows explorer doesn't show right icon size in other view modes (icon, detail, ...). How can i make my application icon change size in different explorer view mode or in different explorer zoom factor like notepad.exe (when you zoom the view, it get bigger or smaller)?
I have tried to build in VC++ 2010, VC++ 2008 but doesn't make better :-(

Does Visual Studio 2010 let you edit icons?

When I double click on a .ico file in Visual Studio 2010 (Professional), it opens what looks like an icon editor. It looks like it should be really easy to pick a color from the left and edit pixels.
But my mouse is a magnifying glass icon. Left click, right click, all they do is toggle zoom on the icon. I can't figure out how to do anything useful.
Am I missing something obvious? Is this icon view as useless as it seems?
You can't directly edit 32-bit color icons but you can convert them manually to 24-bit :
Right click > Add new icon
Open your Icon1.ico file.
Right click > New Image Type or press Ins to open the New Icon Image Type dialog.
Select the format you want, say 96x96, 24 bit or add any custom size and color depth.
Then copy/paste from your 32-bit icon file and save.
Et voilĂ  ! You can now edit your 24-bit color icon.
Doh! I needed to enable View -> Toolbars -> Image Editor.
Thanks to #detale.
The icon is built by an external app.
For Visual Studio 2008 & 2010 image editor,
"Using the Image Editor, you can view 32-bit images, but you cannot edit them."
http://msdn.microsoft.com/en-us/library/s1dadd79.aspx
For the PNG images used as button icons that Visual Studio cannot edit you can use external editor as MS Paint.
open PNG in Visual Studio 2010
right click on the white canvas -> Open External Editor
Visual Studio can edit icons, but not 24-bit color icons.
If you have a Mac OS X machine around, you can edit Windows icons with the Icon Composer application included with the free Developer Tools.
I just discovered this accidentally while working on some cross-platform Mac/Windows code.
I finally found an easy way to do it without visual studio, GIMP
https://www.gimp.org/downloads/
Visual Studio 2022 (available free) has an icon editor built in. Just in case you end up here because you tried to insert a colourful image into a a 256x256 24 bit icon and your colours get messed up: in the editor toolbar on the top right there is a selector for opaque/transparent background, but only when you have a rectangle- or irregular area selection tool active. Default backgroundis set to transparent, you need to set it to opaque to retain your image. (There's a special colour for transparency; though my image does not contain that the colours were wrong)

Resources