Click here to Skip to main content
13,402,312 members (51,526 online)
Click here to Skip to main content
Add your own
alternative version

Stats

8K views
23 bookmarked
Posted 6 Nov 2017

Icon Pro - Create icons for Windows Desktop

, 13 Nov 2017
Rate this:
Please Sign up or sign in to vote.
Icon Pro - A C# + WPF open source tool for creating windows icons from PNG images or SVG vectors

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:

  1. 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!
  2. 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.
  3. 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 :

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:

  1. 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).
  2. Extract an Icon file from an win32 executable (.exe, .dll).
  3. Open an Icon or a Cursor file. Both static and animated cursors are now supported on a very experimental phase.
  4. 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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Herbert Lausmann
Student
Brazil Brazil
No Biography provided

You may also be interested in...

Comments and Discussions

 
QuestionOnly see up to 48x48 size frames from image Pin
asiwel7-Nov-17 16:09
memberasiwel7-Nov-17 16:09 
GeneralRe: Only see up to 48x48 size frames from image Pin
Herbert Lausmann8-Nov-17 3:47
professionalHerbert Lausmann8-Nov-17 3:47 
GeneralRe: Only see up to 48x48 size frames from image Pin
asiwel8-Nov-17 14:28
memberasiwel8-Nov-17 14:28 
GeneralRe: Only see up to 48x48 size frames from image Pin
Herbert Lausmann10-Nov-17 11:46
professionalHerbert Lausmann10-Nov-17 11:46 
GeneralRe: Only see up to 48x48 size frames from image Pin
asiwel10-Nov-17 16:17
memberasiwel10-Nov-17 16:17 
GeneralRe: Only see up to 48x48 size frames from image Pin
Herbert Lausmann11-Nov-17 1:46
professionalHerbert Lausmann11-Nov-17 1:46 
GeneralGreat Improvements Pin
asiwel12-Nov-17 18:32
memberasiwel12-Nov-17 18:32 
GeneralRe: Great Improvements Pin
Herbert Lausmann13-Nov-17 1:49
professionalHerbert Lausmann13-Nov-17 1:49 
NewsANIMATED CURSOR FILES SUPPORT Pin
Herbert Lausmann11-Nov-17 8:32
professionalHerbert Lausmann11-Nov-17 8:32 
GeneralRe: ANIMATED CURSOR FILES SUPPORT Pin
Southmountain11-Nov-17 16:00
memberSouthmountain11-Nov-17 16:00 
GeneralRe: ANIMATED CURSOR FILES SUPPORT Pin
Herbert Lausmann12-Nov-17 0:16
professionalHerbert Lausmann12-Nov-17 0:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180218.2 | Last Updated 13 Nov 2017
Article Copyright 2017 by Herbert Lausmann
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid