Short description

Most popular image editors, such as Adobe Photoshop, oriented to save images into .GIF format, and it can be bothering to convert them into ICO files each time when you have changed the original image. Using this utility you can easily automate this process of converting BMP or GIF files into ICO files.

MakeIcon is a command line utility for Windows 98/2000/XP, that converts images in .GIF, .BMP and also .ICO file formats into Windows icons with desired number of bits per pixel: 1, 4, 8, 16, 24, 32 bits supported. You can use arguments on command line to specify desired number of bits per pixel and a transparency color number for destination icon file.

cool: Additional and very special option of our program is the ability to convert images into C/C++ text mode data, consisting of two values: character index (1..255) and color index (0..255). These data images can be drawn by WriteConsoleOutput function from Windows API.

See the source code example and the sample image.

Download files

Release Version Archive Size Licence
21.04.2006 MakeIcon 1.5 MakeIcon.zip 33Kb FREE
21.04.2006 MakeIcon 1.5 MakeIcon.exe 69Kb FREE
  • Program doesn't require any installation. Place it where your daily utilities are.
  • Also note, that it creates temporary makeicon.log file in its parent directory.
  • If you've encountered any problem or bug, please e-mail me that file.

Command line usage

Syntax:

makeicon.exe [-flags] source.BMP|GIF|ICO [destination.ICO|SCR]

Arguments:

 -bits=(1|4|8|16|24|32) - number of bits per pixel in resulting image
 -transparent[=hex]     - color to use for mask generation
 -format[=.ICO|SCR]     - output file format; icon or C/C++ source
 -preview               - preview resulting image in text-mode
 -logo                  - show logo image in text-mode

Comments:

When destination directory is not specified, startup will be used.

Using text-mode images

The program can be used to generate text-mode images for both: 80x25 and 80x50 character modes.

To generate such an image you must specify option "format=.scr" on the command line. The program then generates the output image in .SCR format which is the source file in C/C++ language. This file than can be included by #include "image.scr" directive.

Here is an example of how to draw a centered text-mode image:

#include <windows.h>
#include "images\MyImage.scr"

int PutScreen (unsigned char Image[])
{
	HANDLE		console;
	CONSOLE_SCREEN_BUFFER_INFO info;
	SMALL_RECT	window;
	CHAR_INFO	*char_info, *char_info_safe;
	COORD		size, pos;
	int		i, key;

	console = GetStdHandle (STD_OUTPUT_HANDLE);
	GetConsoleScreenBufferInfo (console, &info);

		// Read the size
	size.X = *Image++;
	size.Y = *Image++;
	pos.X = pos.Y = 0;

		// Check overlapping
	if (info.dwSize.X < size.X || info.dwSize.Y < size.Y)
		return 0;

		// Calculate a window rectangle to show in
	window.Left = (info.dwSize.X - size.X) / 2;
	window.Top = (info.dwSize.Y - size.Y) / 2;
	window.Right = window.Left + size.X;
	window.Bottom = window.Top + size.Y;

		// Allocate temporary input/output buffers
	char_info = malloc (size.X * size.Y * sizeof (*char_info));
	char_info_safe = malloc (size.X * size.Y * sizeof (*char_info));

		// Read previous image from the screen
	ReadConsoleOutput (console, char_info_safe, size, pos, &window);

		// Pack colors into Windows compatible format
	for (i=size.X * size.Y; --i>=0; )
	{
		char_info[i].Char.AsciiChar = 0xDC; // Special character
		char_info[i].Attributes = Image [i];
	}
		// Show the image
	WriteConsoleOutput (console, char_info, size, pos, &window);
	key = _getch();	// Wait for any pressed key

		// Restore the original image
	WriteConsoleOutput (console, char_info_safe, size, pos, &window);

		// Free buffers
	free (char_info);
	free (char_info_safe);

		// Return the key pressed by user
	return key;
}

void main (void)
{
	PutScreen (MyImage); // draws MyImage
}

Text-mode image in the C/C++ data format

Here is a short example of a text-mode image in the .SCR format compatible with C/C++ languages. It is generated from input images, and can be included into your source file to be drawn by the function like the one above.

unsigned char MyImage [2 + 42 * 9] =
{
0x49, 0x09, 0xFF, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8,

// ... 

0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0xD7, 0xD7, 0xD7, 0x7D, 0x7D, 0x7D, 
0xDF, 0x7F, 0x7F, 0x7F, 0xDF, 0xDF, 0xDF, 0x7F, 0x7F, 0x7F, 0xDF, 0xDF, 0xDF, 
0xFF, 
};

Here is an example of a text-mode image that was drawn from .SCR file. Note that the vertical resolution of the image is equal to doubled number of character rows supported by the current text mode.

This text-mode image was generated from the following .GIF file:

Copyright (c) Sapunov Vladimir 2006. All rights reserved.
E-Mail: makeicon@fyzor.com

Free Downloads Center