---
title: "How can I create arrays for bitmap characters of a font.."  
description: "How can I create arrays for bitmap characters of a font.."  
author: "Madhu Mitha"  
published: 2015-04-01  
updated: 2015-04-01  
canonical: https://www.mindstick.com/forum/23070/how-can-i-create-arrays-for-bitmap-characters-of-a-font  
category: ".net"  
tags: ["vb.net"]  
reading_time: 3 minutes  

---

# How can I create arrays for bitmap characters of a font..

hai..\
\
How can I create [arrays](https://www.mindstick.com/articles/11955/arrays-and-its-limitations) for [bitmap](https://www.mindstick.com/forum/1924/find-image-format-using-bitmap-object-in-c-sharp) [characters](https://answers.mindstick.com/qa/42112/who-is-the-originator-of-avengers-characters) of a font..\
\
Which should be like a [grid](https://www.mindstick.com/forum/369/how-can-i-add-a-column-name-to-my-grid), width in pixels by the height in pixels of the [font size](https://www.mindstick.com/forum/158654/what-is-the-css-property-used-to-specify-the-font-size-of-an-element). With thoise pixels should make shape of a [character](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character) in the grid.\
\
**for example:**\

```
// Font data is Times New Roman 10pt// Character bitmaps for Times New Roman 10ptconst uint_8 timesNewRoman_10ptBitmaps[] = {// @0 'a' (5 pixels wide)0x00, // 0x00, // 0x00, // 0x60, // ## 0x90, // # # 0x70, // ### 0x90, // # # 0x90, // # # 0x78, // ####// @9 'b' (6 pixels wide)0x40, // # 0xC0, // ## 0x40, // # 0x58, // # ## 0x64, // # # #0x44, // # #0x44, // # #0x44, // # #0x38, // ### 
```

\
Is there any possible way to it.. Can [anyone help me](https://www.mindstick.com/forum/331/can-anyone-help-me-out-how-to-use-session-concept) in doing this process.\
\
Thank U

## Replies

### Reply by Madhu Mitha

Sorry Sir, Still i donot start up with my code..I dono from where to start with coding.. I just saw that sample c# program which was related to my project.. So I need help in starting this process.. \
\
Thank U\

### Reply by Anonymous User

Madhu can u show me your code so that i can analyze the problem and try to fix it

### Reply by Madhu Mitha

hai..\
I need with the format of pixel representation ( Ie) Whenever i give a input text it should b converted as a bitmap with height,width of a font..\
Suppose if i give my input as "a" means that string should be displayed in 8*8 matrix.. the filled area of "a" should be given as 1 and others should represent 0..\
for example please see this C# coding I need the same to be displayed in vb.net..I need only the conversion of text..www.eran.io/the-dot-factory-an-lcd-font-and-image-generator/\

### Reply by Anonymous User

Dim a As String() = {"A", "B", "C"}Dim bmp As Image = New Bitmap(100, 100)Dim g As Graphics = Graphics.FromImage(bmp)Dim randomString As String = a(New Random().[Next](a.Length))Dim myFont As New Font("Arial", 6F)Dim size As SizeF = g.MeasureString(randomString, myFont)Dim rect As New PointF(size.Width, size.Height)g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasg.InterpolationMode = InterpolationMode.HighQualityBicubicg.PixelOffsetMode = PixelOffsetMode.HighQualityg.DrawString(randomString, myFont, New SolidBrush(Color.Black), rect)picturebox.Image = bmp

### Reply by Madhu Mitha

hai..\
I need this in vb.net..

### Reply by Anonymous User

Hey if i understand you right you need something like this:

```
//Create String-Arraystring[] a = {"A", "B", "C"}; //Create a Image-Object on which we can paintImage bmp = new Bitmap(100, 100); //Create the Graphics-Object to paint on the BitmapGraphics g = Graphics.FromImage(bmp); //Here we get the random string//Random.Next() gives us the next integer value//Because we dont want to get IndexOutOfBoundException we give the Array length to the Next method//So just the numbers from 0 - Array.Length can be choosen from Next methodstring randomString = a[new Random().Next(a.Length)]; //Your custom Font (6f = 6px)!Font myFont = new Font("Arial", 6f) //Get the perfect Image-Size so that Image-Size = String-SizeSizeF size = g.MeasureString(randomString, myFont);PointF rect = new PointF(size.Width, size.Height);    //Use this to become better Text-Quality on Bitmap.g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;g.InterpolationMode = InterpolationMode.HighQualityBicubic;g.PixelOffsetMode = PixelOffsetMode.HighQuality; //Here we draw the string on the Bitmapg.DrawString(randomString, myFont, new SolidBrush(Color.Black), rect); 
```

You can use the bmp object in your Program. For example:

picturebox.Image = bmp;

I hope you can understand it now :) If you have a problem to understand the Objectdesign you should read a book at first. This is for free ;)


---

Original Source: https://www.mindstick.com/forum/23070/how-can-i-create-arrays-for-bitmap-characters-of-a-font

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
