Demo of adding Unicode text to an image using csXImage in Visual Basic

The ActiveX control csXImage has a DrawText function that allows text to be added to an image. This function fully supports the use of Unicode which means that characters from any language can be used provided that a suitable font is available. For example, this allows text to be written in Japanese, Korean, Chinese, Russian, and many other languages.

The use of Japanese characters is demonstrated with this simple VB application. The application is a single form which includes csXImage and a command button. When the button is clicked, a rough map of Japan is drawn and the names of some of the major cities are written using Kanji characters.

Using ActiveX to add unicode text to an image

The map is first drawn by using the Polygon function. This draws an irregular shaped polygon made from joining a series of points. Four polygons are drawn to represent the main islands. The text is then written, with each city name centred below a small circle on the map.

The font used in this example is "Arial Unicode MS". This is not provided as part of our download. If you do not have this, but have an alternative font to use, the code can easily be edited to change the font.

This demo is available in two versions: one for use with Visual Basic 5 or 6, the other for use with Visual Basic.NET. The appropriate version can be downloaded from the links below.

Visual Basic.NET

To run this demo you need the csXImage trial ocx control installed on your system as well as MS Visual Studio.NET. The trial control and the example files are available below:

Download the trial csXImage control - csXImageTrial.exe (3 MB)

The demo VB.NET project - UnicodeDemoVBNET.zip (65 KB)

Visual Basic 5 or 6

To run this demo you need the csXImage trial ocx control installed on your system as well as MS Visual Basic 5 or 6. The trial control and the example files are available below:

Download the trial csXImage control - csXImageTrial.exe (3 MB)

The demo VB project - UnicodeDemo.zip (4 KB)