QRCode for .NET Compact Framework
OpenNETCFにこんなのものが。
使い方は簡単で、QRCodeDecoderのdecode()メソッドにBitmapを渡すだけ(・∀・)
QRCodeDecoder decoder = new QRCodeDecoder(); // デコード sbyte[] data = decoder.decode( new Bitmap( filename ) ); // 文字列取得 byte[] data2 = new byte[ data.Length ]; Buffer.BlockCopy( data, 0, data2, 0, data.Length ); string text = Encoding.GetEncoding( "Shift_JIS" ).GetString( data2, 0, data2.Length );
こんな感じで、CameraCaptureDialogで取得したファイルを渡しているサンプルもあって。
CameraCaptureDialog ccd = new CameraCaptureDialog(); ccd.Mode = CameraCaptureMode.Still; ccd.StillQuality = CameraCaptureStillQuality.Default; ccd.Title = "Take picture now"; if (ccd.ShowDialog() == DialogResult.OK) { try { QRCodeDecoder decoder = new QRCodeDecoder(); sbyte[] data = decoder.decode(new Bitmap(ccd.FileName)); ...
ちなみにQRCodeEncoderクラスの中身はまだ空っポですね(´ω`)