6

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

jaysonragasa
  • 1,076
  • 1
  • 20
  • 40

5 Answers5

2

and I found this

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

Community
  • 1
  • 1
jaysonragasa
  • 1,076
  • 1
  • 20
  • 40
1

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. :)

Pratik Deoghare
  • 35,497
  • 30
  • 100
  • 146
0

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

Blindy
  • 65,249
  • 10
  • 91
  • 131
  • Thanks! Method Looks promising. But is there a faster way to do this? – jaysonragasa Mar 04 '10 at 09:02
  • Faster in what sense? Development time? – Mark Byers Mar 04 '10 at 09:10
  • 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 – jaysonragasa Mar 04 '10 at 09:14
  • 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 Mar 04 '10 at 09:55
0

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
  • 89,048
  • 55
  • 235
  • 380
0

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
  • 36,616
  • 34
  • 155
  • 231
  • 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). – jaysonragasa Mar 05 '10 at 09:59