Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            //// C# Example
            Libdmtx.EncodeOptions o = new Libdmtx.EncodeOptions();
            byte[] dataToEncode     = Encoding.ASCII.GetBytes("Hello World!");
            Libdmtx.DmtxEncoded en  = Dmtx.Encode(dataToEncode, o);
            pictureBox1.Image = en.Bitmap;

            //byte b  = dmtxEncodeCreate();
            //string s = dmtxVersion();
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        { //decoding
            // C# Example
            Libdmtx.DecodeOptions o = new Libdmtx.DecodeOptions();
            Bitmap b = new Bitmap(@"bitmap.png");

            Libdmtx.DmtxDecoded[] res = Dmtx.Decode(b, o);
            for (uint i = 0; i < res.Length; i++)
            {
                string str = Encoding.ASCII.GetString(res[i].Data).TrimEnd('\0');
                Console.WriteLine("Code " + i + ": " + str);
            }
        }