Text Processing Example : Modify a Hex value on every source code line

Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable text processing tool.

Text Processing Batch Example

Target : Modifying a Hex value on every source code line

  • Convert an image to code : The code array then is visible in the Text editor ( see below )

Example here see the two first hex values : 0x01 and 0x70

Bitmap2LCD Batch Text Processing 1

 

In the Text Processing Window, create a new batch and write this program, using the choice comboboxes and the editors located upwards the program lines :

Bitmap2LCD Batch Text Processing 2

if ‘0x’
      then get hex (0)                         –> Hex value prefix is already 0x in the configuration settings
shift left (1)
      then overwrite (index)’    ‘    –> 4 x space inside the string
      then insert hex (index)

Remark : Everything between two “if conditions” is one block of functions for this “if condition” !

On every text editor line, checks if ‘0x’ is found and if condition is “true”, gets the first hex value (index 0) , shifts left  the hex value of 1 bit to the left , overwrites source from the index where the ‘0x’ was found with four space chars,  and finally inserts the shifted hex value at the index position…

Activate the new batch and run it over the text editor.

Bitmap2LCD Batch Text Processing 3

The source file in the Text Editor has been modified (red arrow)

You can read the processing report journal (blue arrow)

 

 

 

 

 

Bitmap2LCD : General info about Configuration Settings

Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable text processing tool.

Bitmap2LCD : General info about Configuration Settings

OBSOLETE Article : For older versions

To open the various configuration settings Panel, click one of the button in the main form (red arrows)

Bitmap2lcd_Config Settings

At the right side, you can define the data syntax (green arrow) and the access the output file header (red arrow)

To edit the header, click on the top right button (blue arrow)

bitmap2lcd Configuration Settings

bitmap2lcd Header Settings

 

A set of configuration settings can be saved as a project , for example in the case you manage different projects and different Graphic LCD

Bitmap2lcd Project Folders

 

 

Switching OFF the Internal Web Browser

Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable text processing tool.

Switching OFF the Internal Web Browser

From Version V2.8H (B2) the internal Help Web Browser (blue arrow) , to access to the online tutorials can be enabled or disabled (red Arrow) in the configuration panel (green arrows)

Of course, you can use your own favorite web browser to access the help topics and tutorials !

Please note that this feature needs to have the Microsoft Internet Explorer installed on the computer. It’s for Bitmap2LCD’s internal use. In case IE can’t be found, the internal Help Web browser will permanently be switched OFF.

bitmap2lcd Internal Web Browser Disable

How to Use Bitmap2CLD ? (before Version 3.0)

Obsolete article !

 

Link for Versions V3.0+

For a quick access to the help and tutorials, click the following button in the main menu

bitmap2lcd_tuto_0

 A short tutorial

Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable text processing tool.

The Windows

bitmap2lcd_tuto_2

Bitmap2LCD is a multi-window application and supports dual screen.

List of the windows : Main window, LCD Viewer, Configuration Settings, File explorer, Graphic and Editors Window, Tool menu, Work Canvas, Adjustments, Font Panel and internal Web browser.

You can show or hide (minimize) the windows and move them to the secundary monitor.

The above arrow  shows where to open and show these windows

 

Projects, Artworks and Filenames

A project is a set of configuration settings ( There are many possible settings ! )

If you work on different GLCD projects, you can save the “current” settings inside a Project name. It’s the easiest and fastest way to switch from one to another.

A so called “artwork” is a set of files related to the graphic filename : In the below example a graphic saved for example as NewBitmap.BMP , will be converted to an output file called NewBitmap.h , and the associated touch panel file will then be named NewBitmap.TSC (Red Arrow)  

When you save your “artworkAS (yellow arrow), as a bitmap,  you will change the basic filenames

bitmap2lcd_tuto_1

 

Load a graphic

 

  • You can either use the direct graphic load by dialog located at the top of main menu File

or

  • switch to the file explorer / or click Load graphic File in main menu File (fig1. red arrow)
  • In the list of files, click to select your particular graphic file you want to load (fig1 blue arrow) , it appears in the graphics viewer window at the right side.
  • Resize or turn/tilt the preview image using the buttons located at the top of the graphic preview.
  • Double click in the graphics viewer (yellow arrow) or the click the import button located at the top or bottom of the preview (fig1. Green arrow)

bitmap2lcd_tuto_3

fig1. File explorer view

If the graphic is larger than the Work Canvas a message box will ask you if you want resize the image to fit the canvas or not.

The graphic will be imported in the selection layer not directly into the Work Canvas (fig2. imagine your own graphic inside the canvas)

The red frame (fig2. red arrow) around the canvas means that you will have to paste the graphic into the canvas after moving it, convert it. When outline frame is red, it means that a “floating ” selection layer above the canvas is displayed…

The imported graphic can be moved around above the Work canvas : Move/drag the red frame to the desired canvas location with the left mouse button pressed. (fig2. blue arrows)

Then Paste the selection layer (fig2. green arrow) The red frame in the frame and around the work canvas dissapears. (There are also other ways to Paste, in menus, using the return key etc..)

bitmap2lcd_tuto_5

 

fig2. Import a graphic file

 

Converting a bitmap to GLCD data.

bitmap2lcd_tuto_4

Start a conversion (fig3. red arrow)

Your hexadecimal file appears in the outputs editor, formatted according to the defined configuration settings. (fig4)

bitmap2lcd_tuto_6

 

Fig 4 Bitmap has been converted to the Hexadecimal, decimal or binary  file in the text editor.

 

Color picker

Bitmap2LCD has built in functions wich are very similar to the popular MS Paint program

You can select the foreground (pen color) and background colors (brush color) for painting and writing text by clicking in the color boxes of the menu window.

You can copy foreground color to background colors or swap them when clicking in the small boxes around the colors boxes.

bitmap2lcd colorpickers

 

Fig 5 The Colorpicker ( Here the 16 gray levels mode and the Color mode pickers)

 

Drawing tools

In the main menu window or at the top of the work canvas , you can access the various drawing tools (also accessible from the main menu)

The main menu is located at the right side (arrow) and the sub-menu at the right side.

drawing tools

Fig 6 drawing tools

Write a text

There are 2 different ways to write text inside the work canvas :

  • The Text Field Editor located in the Visual Components Main menu
  • The single line editor described below

In the “write text” submenu, you can open the font window (green arrow) and write text in the work canvas : first click the button (orange arrow) and click inside the work canvas where to open a new text area.

Bitmap2LCD write text

Fig 7  Fonts and draw a text

 

Find the Configuration Settings

bitmap2lcd_tuto_7

The configuration settings for the conversion are accessible from the main toolbar : Visit then main the menu items , Mode , LCD matrix , Output and the configuration settings window (arrow)

 

 

Bitmap2LCD : Running a Processing Batch

Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable text processing tool.

Running Processing Batch run runx

Article updated for V3.7c

There a many ways to run a Processing Batch :

  • Loading a Batch Program file into the text editor, start the active text processing batch for a single run run
  • Manually running a batch after conversion of a GLCD image or after conversion of a GLCD font, data being present in the text editor.
  • Chain an automatic post-processing after every image or font conversion.
  • Running a Processing batch on multiple defined files in a defined folder runx

The active batch (blue arrow) will be started in case of “manual” starts

bitmap2lcd-batch-processing-menu_2

if the Silent checkbox is checked (green arrow fig 2) , the message on screen with the number of processing occurrences found at the end of the text processing will not be displayed. ( Not needed in case of multiple file text processing )

Bitmap2CLD Running Text Processing 2

fig 2)

Bitmap2LCD : Activate a Processing Batch

Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable text processing tool.

Activate a Processing Batch

1. List the existing batches (blue arrow)

2. Click the selected Processing batch in the list inside the File Explorer

3. The selected Batch Processing Program appears in the editor window

4. Activate the present Text Processing  Batch (red arrow)

5. The activated batch filename appears in the menu (green arrow)

Another way to select a batch is to right-click in the batch list after having selected the wanted batch. In the pop-up menu, there’s an item to do that.

bitmap2lcd-batch-processing-activate

 

Bitmap2LCD : Text processing on multiple files located in a folder

Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable text processing tool.

Text processing on multiple files located in a folder

From Bitmap2CD Standard Edition V2.8d, a text processing batch can be run on defined multiple files located in a defined folder.

1. In the File Explorer, select the folder where the source files are located  (blue arrow, fig 1)

2. Open the Configuration Settings Panel , click the Text Process tab

3 Click on the Folder Select button (red arrow)

4 The selected folder appears in the field (orange arrow) This field will be saved with the configurations settings when closing the program.

5. Define the file extension, for example : “.txt”  or “.csv”  or “.h”  Only the files with this extension in the folder ( case sensitive ) will be text processed.

Bitmap2CLD Multiple File Text Processing 1

fig 1)

The selected batch (see red arrow fig 2) can be started from the menu or from the text processing panel (green arrows fig2)

If no batch allready activated, list the batch files with the button at the left of blue arrow, choose the batch you want to run in the list and activate it ( blue arrow fig2 )

Bitmap2CLD Multiple File Text Processing 2

fig 2)

At the end of a Multiple file Text processing run, a journal is displayed (fig 3 below)

It lists the source folder and file, the destination folder and file and the number of Text processing occurences found

The destination folder is the source folder name + _processed

The source files in the source folder are not modified

Bitmap2CLD Multiple File Text Processing 3

fig 3)

Bitmap2LCD Project Roadmap

Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a graphic and text file processing tool

The development roadmap of this software tool will soon be reaching its destination.

But for now, it’s still under development and is still supported !

Project Roadmap

 

Bitmap2LCD : About the filenames

Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems.

About the filenames in bitmap2LCD

Basically the filenames in bitmap2LCD are all associated to the Artwork “bitmap” filename.

In the “File” main menu, you can see the active project, the bitmap and the data output filenames (green arrow)

OUTPUT : The data output file extension can be selected in the configuration settings panel (Main settings + data syntax tab)

IMAGE : is always a bitmap (.BMP) – or a gif if it’s a GLCD animation project (.GIF) –

Bitmap2lcd About filenames

A touch panel part of an artwork will also have a similar filename.

To save an artwork under a new or different filename, click in the main menu  (red arrow) and define the new “artwork” filename ( a bmp ! ) . (This function is also accessible from the work canvas side buttons )

Newbitmap” is the default artwork name : NewBitmap.bmp and NewBitmap.h

 

Bitmap2LCD : Hide and Show the Desktop Icons

Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems.

Hide and Show the Desktop Icons

When using the programming tool with the floating windows style ( instead of the MDi Style – with the Main Form beeing a Background and an optional Wallpaper -) , in other words when the desktop wallpaper becomes the program wallpaper, you can choose to hide / show the destop icons using a button located in the main buttons bar (red arrow)

Bitmap2lcd Show Hide Desktop Icons

In the Configuration settings, a checkbox can be checked to automatically hide the desktop icons at start and show them again when the program is closed (see red arrows below)

Bitmap2lcd Desktop Icons Config 2