Username:     
Password:     
             

Projects
image2primer 1.0
 
The image2primer can convert Images (such as bmp, jpg, gif, png...) in a header file. The header file includes a value for every pixel in the Image.

Code size:depending on image Author:mebe
Source files included:yes Version:1.0
Use circleOS:yes (V1.5) Creation date:2008-12-28 15:34:14
Hardware modification:no Modification date:2009-01-02 12:52:00
Based on the STM32 Primer:All
   
Downloads:2299 Views:26637
   
Vote:
Average ratings:3.09/5 (242 rates)

Download:    image2primer-1.0.zip (103 KB)

Description:

: Note :
This project requires Microsoft's .NET-Framework 2.0 or higher.

The image2primer can convert Images (such as bmp, jpg, gif, png...) in a header
file. The header file includes a value for every pixel in the Image.

: Note :
The idea for this small project was given from the user "Ilm" by the
"RGBPicToHeader"-project. This is only a version with some improvements.

: Note :
Image-Headerfiles become very large. For each pixel in the Image two bytes are
required. The maximum image-size for the primer is about 50x50 pixels.

: Improvements (relatet to the RGBPicToHeader) :
- Correct color-calculation
- Background-color-set
- Therefore You can also use images with transparencitys (such as png-files).


: How to create the headerfile :
1. Launch the image2primer.exe
2. Click on the "Load image"-Button and select the image-file
3. If you want, select your background-color (normally black)
4. Click on "Convert" and select the destination-file. (*.h)


: How to draw the image on the primer :
The integration is the same as with the RGBPicToHeader-project.

Add the following code to your application:

/* Public variables --------------------------------------------------------*/

// The example-image-declaration
static const u16 image[] = {
   #include "example.png.h"
};

/* Your Programm ------------------------------

// Anywhere in the program.
DRAW_SetImage(image, 48, 48, 32, 32) ;  // 32x32 Image Size

: Note :
You may use the image in more than one position on the screen.
e.g. you can use an image as a playing-stone in a game, which
is used many times.


_______________________________________________________________________________
[2008/12/28] - Benjamin Meier                       Copyright (c) 2008 Onlywork