views:

117

answers:

5

Hi guys,

Can you help me look for a way to convert char into 8x8 binary (am not sure how to call it)

like for example an "A"

00011000
00100100
00100100
01000010
01111110
10000001
10000001
10000001

am actually doing this manually :(

suggestions are still open :D

EDIT: Anyway, if you guys are wondering what am trying to do.

Am trying to make this LED Wave Display. But since I don't have a computer interfacing knowledge. I just want to try it in Windows Mobile. LOL

A: 

You could create an 8x8 Bitmap and draw characters on it one by one, then with GetPixel read back the image created.

Blindy
Thanks! Method Looks promising. But is there a faster way to do this?
Nullstr1ng
Faster in what sense? Development time?
Mark Byers
Nope. I mean faster in Runtime. I was thinking to cache it so I don't have to read those bits everytime. I found something on codeproject.com
Nullstr1ng
Well once you get the bits once, you can output them as a .cs file (in an inline `byte` array) and add it to your project then use the arrays you generated directly. Can't get faster than this! Plus the size of the executable will be small because of the small amount of data required (8*8*256 bytes is 64k and you probably don't even need all 256 characters).
Blindy
A: 

Is this for some kind of external (e.g. LED, VFD) display? How many characters do you need to convert? Just alphanumeric and a few punctuation characters or every single Unicode code point?

Sad to say, you might actually be better off simply doing it by hand. This allows you to tweak the output for the characteristics of your display, compared to being stuck with a specific font.

Alternatively, use your favourite paint program to create an 8-pixel high bitmap strip (in black and white) with your chosen glyphs, and then load that into your application.

Roger Lipscombe
+2  A: 

and I found this

alt text http://www.codeproject.com/KB/miscctrl/LedDisplay.aspx

Nullstr1ng
+1  A: 

There is a image format in which you provide width and height on the first line and then zeros and ones.

P1 7 3
0001000
0011100
0110010

I am searching for its name.

EDIT Yeah, got it.

Its called Portable Bitmap Format.

Example Usage. :)

TheMachineCharmer
Also this should be pretty fast!
TheMachineCharmer
A: 

I assume this is for some kind of LED/VFD display as Roger suggests. In that case, whats wrong with just hardcoding each letter? That will run much faster than any kind of on-the-fly calculation. You've suggested caching yourself, but whats the point? Why would you dynamically generate (and then cache) something which will always be the same. How often are you going to want to change alphabet? Hardcode it and stop trying to over-engineer a problem that doesnt exist.

Andrew Bullock
That's my first thought actually.Then Blindly gave an idea.. I thought I'll just cache it, so I don't have to read the image everytime a letter or text is changed.But at the end, I just hardcoded the letters, but still cached the character data (the 8x8 of 1 and zeros).
Nullstr1ng