开发者

C# way to convert char into 8x8 binary

开发者 https://www.devze.com 2022-12-22 08:26 出处:网络
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\"

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
00开发者_运维百科100100
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


and I found this

C# way to convert char into 8x8 binary

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


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


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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号