[Zxing , QR Sample ] C# 에서 QR 라이브러리 사용하기





실버라이트 용 QR 라이브러리도 코드플렉스에 있지만.. 요걸 사용하고 싶었다 .

그런데 요놈은 c# 용 레퍼런스가 아무것도 없었다 . 자바와 ios 는 잘되어 있던데 .,

그래서 AS3 용 코드를 보고 어영부영 따라해 보았다.










using
System; using System.Drawing; using System.Windows.Forms; using AForge.Video.DirectShow; using AForge.Controls; using System.Collections; using com.google.zxing; using com.google.zxing.common; using com.google.zxing.qrcode; using trace; namespace Xing_TEST { public partial class Form1 : Form { public static traceDele trace = new traceDele(traceCS.traceMethod); public Form1() { InitializeComponent(); } //aforge player private VideoSourcePlayer player; //render Data private Bitmap captureData; //render Region private Rectangle captureBound; //renderTimer private Timer timer; //qr member private Reader reader; private Hashtable hint; protected override void OnLoad(EventArgs e) { //aforge initialize player = new VideoSourcePlayer(); player.Width = 320; player.Height = 240; FilterInfoCollection device = new FilterInfoCollection(FilterCategory.VideoInputDevice); VideoCaptureDevice cam = new VideoCaptureDevice(device[0].MonikerString); player.VideoSource = cam; player.Start(); this.Controls.Add(player); //captureData initialize captureBound = new Rectangle(player.Location.X , player.Location.Y , player.Width+100, player.Height); captureData = new Bitmap(player.Width, player.Height); Graphics g = Graphics.FromImage(captureData); //QR initialize reader = new QRCodeReader(); hint = new Hashtable(); hint.Add(DecodeHintType.POSSIBLE_FORMATS, BarcodeFormat.QR_CODE); //render timer initialize timer = new Timer(); timer.Tick += new EventHandler(timer_Tick); timer.Interval = 30; timer.Start(); base.OnLoad(e); } void timer_Tick(object sender, EventArgs e) { //capture DrawToBitmap(captureData, captureBound); pictureBox1.Image = captureData; //QR processing RGBLuminanceSource source = new RGBLuminanceSource(captureData, captureData.Width, captureData.Height); BinaryBitmap img = new BinaryBitmap(new GlobalHistogramBinarizer(source)); Result result = null; try { //QR success result = reader.decode(img, hint); } catch{} if (result == null) { //QR fail label1.Text = "no decode!"; } else { //QR Success label1.Text = result.Text; label2.Text = result.BarcodeFormat.ToString(); } } //close protected override void OnClosed(EventArgs e) { trace("Close!"); timer.Stop(); player.SignalToStop(); player.WaitForStop(); base.OnClosed(e); } } }
Yamecoder 야매코더_
tags : , ,
C# 2011. 1. 7. 18:24

댓글을 달아 주세요

  1. 이전 댓글 더보기
  2. BlogIcon cheap nhl jerseys from china 2014.12.05 00:02  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  3. BlogIcon 3xl NBA Jerseys 2014.12.29 07:22  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  4. BlogIcon Knock Off Baseball Jerseys 2014.12.29 07:24  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  5. 匿名 2015.01.07 17:45  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  6. 匿名 2015.01.15 12:20  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  7. 匿名 2015.01.15 12:22  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  8. 匿名 2015.01.19 10:54  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  9. BlogIcon 2012 Pro Bowl Jerseys 2015.01.29 01:34  수정/삭제  댓글쓰기

    어있Oakland Raiders Jerseys ,Seattle Supersonic JerseysKansas City Chiefs Jerseys nfl jerseys usa net Chile Jerseys

    American League

    “He was trying to make something happen,New England Patriots Jerseys, and things didn’t work,Sports Apparel Online Usa," Chiefs coach Andy Reid said. “Those are calls down there,95 All Star Jerseys, opportunities for shots. They had him covered."어및

  10. BlogIcon San Diego Chargers Jerseys 2015.01.29 18:18  수정/삭제  댓글쓰기

    지가New York Islanders Jerseys cheap Thunder jerseys from china California Angels Jerseys nfl jerseys cheap
    ,Cheap Nhl Hockey Jerseys


    2,Mlb New York Yankees. Being Rude Or Demanding

    Carroll singled out two players -- rookie right tackle Justin Britt and left guard James Carpenter,Customized NFL Jerseys.

    Rice was suspended for two games by NFL Commissioner Roger Goodell,Miami Hurricanes J에이

  11. BlogIcon Cheap Ncaa Jerseys 2015.01.29 18:20  수정/삭제  댓글쓰기

    료없San Francisco 49ers Jerseys Super Bowl Jerseys ,Oregon Ducks Jerseyssan jose sharks jerseys new york yankees jerseys

    The Nets finished 28th in defensive rebound rate last season. And putting together a good defensive possession means forcing a missed shot and then not allowing second and third-chance opportunities,Cheap Nhl Jerseys, something the Nets struggled mightily with in 2013-14.


    스들

  12. 匿名 2015.02.06 14:13  수정/삭제  댓글쓰기

    서마永恒之塔服务端传奇服务端密传-服务端QQ西游私服务端天堂1私服务端

    千年服务端蜀门服务端征途服务端机战服务端神泣服务端醉西游服务端

    天堂I服务端挑战OL服务端剑侠情缘-服务端奇侠XIAH服务端挑战服务端


    传世开私服一条龙服务-

    传奇开私服一条龙开区服务-


    传奇广告代理-

    IDC服务器以及空间租用-

    魔兽世界sf开服一条龙服务-


    客服咨询QQ(企鹅扣扣)1285574370

    Email:1285574370@qq.com

    更多商业版本免费开放下载




    天恒科技1.95皓月终极12星座道士加强升级版



    天恒科技1.85荣耀必杀极限之地广寒宫泡点元素PK版



    天恒科技1.85无特戒无英雄轻中变魔神唯我独尊麻痹宝宝



    天恒科技独家1.85恶魔世界装备分身15转八钻靓装元素中变版종이

  13. 匿名 2015.02.11 14:03  수정/삭제  댓글쓰기

    지니传奇世界服务端刀剑服务端十二之天服务端新天骄服务端卧龙吟服务端

    真封神服务端惊天动地服务端红月服务端魔力宝贝服务端飞飞务服务端

    劲舞团服务端热血江湖服务端倚天I服务端网页游戏服务端天堂2服务端


    热血江湖开sf一条龙服务-

    传世开私服版本一条龙服务-


    传奇广告代理-

    IDC服务器以及空间租用-


    客服咨询QQ(企鹅扣扣)1207542352

    Email:1207542352@qq.com

    更多商业版本免费开放下载




    起点数据图腾变身1.950已开十六区永恒皓月淘宝商城无特戒无



    起点数据独家1.90七彩刺影狂雷合击绝杀版传奇服务端



    起点数据1.995已开四区变身皓月特殊副本积分系统太极魔阵三



    起点数据1.96黄金丛林传奇庄园聚魔禁地天地使者黄金皓月版传



    起点数크히

  14. 匿名 2015.02.11 14:03  수정/삭제  댓글쓰기

    크한永恒之塔服务端传奇服务端密传-服务端QQ西游私服务端天堂1私服务端

    千年服务端蜀门服务端征途服务端机战服务端神泣服务端醉西游服务端

    天堂I服务端挑战OL服务端剑侠情缘-服务端奇侠XIAH服务端挑战服务端


    传世开私服一条龙服务-

    传奇开私服一条龙开区服务-


    传奇广告代理-

    IDC服务器以及空间租用-

    魔兽世界sf开服一条龙服务-


    客服咨询QQ(企鹅扣扣)1285574370

    Email:1285574370@qq.com

    更多商业版本免费开放下载




    天恒科技1.95皓月终极12星座道士加强升级版



    天恒科技1.85荣耀必杀极限之地广寒宫泡点元素PK版



    天恒科技1.85无特戒无英雄轻中变魔神唯我独尊麻痹宝宝



    天恒科技独家1.85恶魔世界装备分身15转八钻靓装元素中变版데지

  15. BlogIcon samsung note edge Online store 2015.03.16 09:01  수정/삭제  댓글쓰기

    야겠Recap- you just told lord sesshomaru a lie about why you were crying and then bowed and started running a way from him and Rin...
    kk!
    Your legs finnaly gave in under you. you fall forward and land right in front of a tree. you craw the best that you could under it when all of a sudden it sarted to rain.....why....why did my family, my village,Buy iPhone 6 from china Willo,Wholesale macbook air f일할

  16. BlogIcon basket burberry 2015.03.31 00:03  수정/삭제  댓글쓰기

    상마ne peuvent consulter. de diffusion,trench burberry homme pas cher,Selon le rapport du site de Jane's Defence Weekly,Maman n'a pas bougé le fourrage, soldats et civils de la Chine avec les pays - Bas ensemble dans le travail. prisonnier.URL aIci sur ordre du Président de La Fédération de Russie?03.
    Facebook20 Maxim chvanov: 44 27. le temps de mise à jour de sou일할

  17. 匿名 2015.03.31 08:50  수정/삭제  댓글쓰기

    표관Clothing and socks in the store appeared to be two or three times. Tents were dirty and filthy and in the corner of the store, he was also a lot of fire. A & F is always in style.






    It is also so much easier to do full research on an item online. People constantly write up reviews on the product, which you can have at hand. You do not need to ask around yourself, and you can receive fir마뉴

  18. 匿名 2015.04.03 13:49  수정/삭제  댓글쓰기

    의일1111





    With the ever increasing number of vehicles on road, the recklessness of people while driving and their adventure to break the traffic rules have resulted in a large number of accidents being reported every day. Some of the accidents are fatal which results in the death or serious injuries and in some incident people escape with minor injuries. Whatever the case may be, your vehicl습는

  19. 匿名 2015.04.03 17:37  수정/삭제  댓글쓰기

    뉴드Because Motorcycles lack the protection of other vehicles, such as a car or truck,5 Interior Decorating Tips Fo, severe injury is much more likely. For comfort and protection they generally have fabric and foam interiors. Motorcycle helmets act as a protection device for your head.





    火车采集器html简单模板示范







    Safety helmets for motorcycle users are the law in many states, optional in이메

  20. 匿名 2015.04.04 02:54  수정/삭제  댓글쓰기

    는리火车采集器html简单模板示范






    Making Money Online Simply by Being an Affiliate







    [标签:来源]








    If you are thinking about attempting to work from home and online, but you have no idea where to start, what to do,Why Islamic Shops Make Finding Halal Food Easy_59476., or what to sell,Is It Safe To Shop Online-_55619., the easiest way to get yourself into the know is to start off버종

  21. 匿名 2015.04.09 00:24  수정/삭제  댓글쓰기

    전히Lacoste boots and a beret big mesh, or even the entire pleated skirt,Shopping For Every Budget in Athens_59592., tights and wool biker boots. The more adventurous may try to marry a trio monochrome black carrot trousers.



    Badia will be a mini-skirt skater, opaque tights and Minnetonka for a look kindly teenager, as she wants deliciously shifted pair of trousers,Ecommerce Shopping Cart - Wha,어뉴

Powerd by Tistory, designed by criuce
rss