How To Create an Icon for Visual Studio with just MSPaint and Visual Studio - 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.

Related

Visual Studio lower icon pixels

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!

wanna have a designer for a REPX file - VS13/DevExpress

I want to open a repx file with a designer.
(but now, I only see the code behind)
I have installed Visual Studio 2013 and DevExpress.
I just want to add 3 paramters to a printer lable.
The existing file was made with XtraReport - maybe that helps.
Thx.
First, open or create a blank XtraReport file in design mode in Visual Studio. Then, click on the Tasks tag on the upper-left corner of the report design surface. From the pop-up menu, click on "Open/Import" and select a .repx file.

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)

How to visualize the content of Graphics variable in Visual Studio 2010 during debug?

I am working on a rendering engine for my application and need to visualize the Graphics object during the debug session.
I looked at Image Visualizers for VS2010, like this or this, but they visualize only the Image objects, whereas I need the Graphics. What could be a solution here?
Regards,
Alexander.
I finally figured it out on my own.
To enable the visualisation of Graphics variables in VS2010 do the following:
Download the Graphics Debugger Visualizer from this Code Project page (use the pre-compiled DLL version).
Extract the DLL to the location where you have full rights.
Right-click the DLL and press "Unblock" button on the first tab, in the right bottom corner. Click "Apply" and then "OK" to close the Properties Window.
Copy the DLL to the following location:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\Visualizers
-or-
C:\Program Files\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\Visualizers
depending upon your system architecture.
You don't have to restart VS2010, just run a debugging session and you'll see a small magnifying glass sign just to the left of the variable type name when you hover with you mouse cursor over your variable. Click this sign and you'll see the content of your Graphics object opened in a new window.
Enjoy!

Resources