I have the following symbol which is a ! written in C++:
const UINT8 ras[1][28] ={ {0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00} }; //'!'
Now I need to create this in C# as a symbol and print it on a console or image, how is that possible?
I know it is supposed to print a !. But how do I got from my array to !?
This looks like a 16×14-pixel bitmap. If we take the bytes two by two, we get:
Now, the binary pattern for the value
0x30is00110000, so it looks like an exclamation point with a 2×2-pixel dot, and a 2×8-pixel vertical part, like so (keeping only the left-most byte, since the right-most on each line is 0 or blank):Obviously, it’s also up-side down. Using the above information, you should be able to create e.g. a plain old
Bitmapand initialize it so you get something you eventually display in C#. Of course, that sounds a bit round-about for this very simplistic image, but still.To initialize the Bitmap, you would do something like:
Note that this code is very rough, I’m really not a C# developer. Treat it as pseudo-code.