Introduction
Ever needed to create an icon for your Windows Desktop project?
Well, I did, and many times. Nowadays, we can find some nice Websites that provide easy ways to create a Windows Icon file from a PNG image. But, in the past, things were different. Some years ago, before the explosion of the mobile development world, finding a good, and more important, free tool to help create an icon was a really tough deal!
That's why I begun the development of this tool some years ago. And now, I've just updated and uploaded it to GITHUB, in the way that everyone can make use of it and, if want, help in the development process.
In fact, it might not seems to be this way but, the icon of a software is like its profile picture. Our mind associates that tiny picture with our program. So, you should expend more time creating a particular Icon that defines your application.
Think about it!
With this cool open source tool, you will be able to design you application's icon, on your favorite program (Like GIMP, Illustrator, Corel), export it to a PNG image or even a SVG vector and just open Icon Pro and import that image. It will do all the background work, generating all the multiple size frames from that single image.
With a few clicks, your icon will be there for you!
Please, note that, even though I've done lots of researches and studied a lot about icon files, this software might be still not perfect.
If you find a bug, help me out to fix it. Write a reply, tell me what's wrong, let's share some code. Please, don't vote down, the main goal here is to build a simple, free and open source tool to help everyone.
Background
So, this is a WPF application, written in C# (7.1) for Microsoft .NET Framework 4.6.1.
This tool is, basically, a complement for my project described here:
There, you can understand a little bit more about its background.
But, for now, I'm going to tell you the most important things about its background:
It's divided into layers, 3 layers:
- The first layer is the Core API. The core works with bytes and bits, and provides the basic operations for opening and writing Icons and Static Cursors. Yeah, this tool comes with a
CursorBitmapDecoder
and a CursorBitmapEncoder
as well! - The second layer is the WPF Library. It's a wrapper around the Core API. It brings to the Windows Presentation Foundation four important objects:
IconBitmapEncoder
, IconBitmapDecoder
, CursorBitmapEncoder
, CursorBitmapDecoder
. - The third layer is the Application itself, a WPF Windows Application! It provides a very simple and objective GUI for working with Icons!
This tool allows you to extract icons from executables (.exe and .dll). This very cool functionality is based on the great article below by Tsuda Kageyu:
This tool can open Windows Cursor files (.cur), but still, there's no implemented functionality that allows you to create one, even though that's already possible with the CursorBitmapEncoder
class.
With the use of the great API SVG.NET, this application lets you create an Icon from a SVG vector file. You can, as well, create an Icon file from a PNG image!
In short words, the main functionalities of this program are:
- Create an Icon file from a single PNG or SVG image. You design your icon once, and the software will generate all the icon frame sizes from that single image (That must be 256x256px).
- Extract an Icon file from an win32 executable (.exe, .dll).
- Open an Icon or a Cursor file. Both static and animated cursors are now supported on a very experimental phase.
- Create an Icon from a folder containing all the frames and its different sizes and bit depths.
Now, after lots of researches I've successful implemented an very experimental support for opening Animated Cursors. I would like to mention the great article series by Jeff Friesen that helped me a lot understing the structure of the cursor files!
Introduce Animated Cursors to Java GUIs, Part 1 | Let There Be Animated Cursors
On the latest updates, I've included a piece of code from the great article bellow:
IconLib - Icons Unfolded (MultiIcon and Windows Vista supported) - CodeProject
The code I've included is related to the AND mask creation.
Using the Code
Actually, you don't need to write even one single line of code to create an icon, but, in the background, this tool and the libraries behind it, allows you to code things like this:
IconPro.Lib.Wpf.IconBitmapEncoder encoder = new Lib.Wpf.IconBitmapEncoder();
encoder.UsePngCompression = compression;
foreach (Models.IconFrameModel fr in _Frames)
{
encoder.Frames.Add(System.Windows.Media.Imaging.BitmapFrame.Create(fr.Frame));
}
encoder.Save(Output);
encoder = null;
Points of Interest and Considerations
Okay, I know, it's 2017 and now everything is about Mobile Development, and it makes no much sense to publish a project to handle files from the past century. But, I found the development of this tool very fun, and, as it can be useful for someone, I'm publishing it for everyone on GITHUB.
I would like to thanks asiwel for pointing out some issues and bugs. Thanks to him, I've made some changes and fixed some bugs.
There you can find the source code and the release:
History and Road-map
I'd like to present the road-map for this tool. Currently, I'm doing improvements on PHASE 2. But there is already som progress towards the PHASE 3. For example, the Core Lib already contains a namespace, called Motion, with some classes to handle Animated Cursor files. Even though that it is on a very experimental stage, this codes lets you open animated cursor files and view its frames. In fact, the core library is already on version 2.2.x while the rest of the codes are still on version 1.x.x.
- The development begun in 2013
- First release in 2014 - Created the GUI, and almost all the functionalities
- Some updates in 2015
- Major updates in November 2017 - Code uploaded to GITHUB, and ported to Visual Studio 2017 and NET STANDARD 2.0; Added support for cursor files; Added support for SVG files
- 11/11/2017 - Build 238 released and codes updated on GITHUB. I rewrote the core library to be easier to understand. Some overall bug fixes as well.
- 13/11/2017 - Some small bug fixes. Added experimental support for Animated cursor files. Road-map released. Short demo video uploaded.