New topic: Free QR Code genarator Class using Google API
<http://forums.realsoftware.com/viewtopic.php?t=41055> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message basestring Post subject: Free QR Code genarator Class using Google APIPosted: Tue Oct 18, 2011 9:40 pm Joined: Sat May 28, 2011 11:28 pm Posts: 58 Location: Beijing China Hi folks, I'm working on a QR Code generator, but it's harder then i though and takes some time However i created one that uses the Google API, the only problem is that you need to be connected to the internet you can download the class here. http://www.dj-basestring.com/realclasses/GoogleQRCode.rbo here is a sample code on how to use the Class This will generate Real basic is Cool in QR Code in a 300x300 pixel image and draw it in a canvas the QR Code is encoded as UTF-8 with the highest error level correction H Error level correction has 4 settings L, M, Q and H L = 7% M= 15% Q = 25% H = 30% Encoding has 3 settings. Code:qrcode.Encoding = qrcode.UTF_8 Code:qrcode.Encoding = qrcode.Shift_JIS Code:qrcode.Encoding = qrcode.ISO_8859_1 Code: dim qrcode as GoogleQRCode qrcode = new GoogleQRCode qrcode.QRData = "Realbasic is Cool"" qrcode.Width = 300 qrcode.height = 300 qrcode.ErrorLevelLMQH = "H" qrcode.Encoding = qrcode.UTF_8 if qrcode.Create_QR then Canvas1.Graphics.DrawPicture (qrcode.QRCODE,0,0) else msgbox str(qrcode.Error_Code) + " - " + qrcode.Error_MSG end if If you have any question, just let me know Cheers _________________ For great Music got to my podcast Website!!! http://podcast.1945mf-china.com Top basestring Post subject: Re: Free QR Code genarator Class using Google APIPosted: Tue Oct 18, 2011 11:05 pm Joined: Sat May 28, 2011 11:28 pm Posts: 58 Location: Beijing China If you want to save the barcode as image, you can use this code Code: dim dlg as SaveAsDialog dim f as FolderItem dim ft as new FileType ft.name = "Image/Jpeg" ft.MacType = "JPEG" ft.Extensions = "jpg;jpeg" dlg = new SaveAsDialog dlg.Title = "save QR Code Image as JPG" dlg.Filter = ft f=dlg.ShowModal() if f <> NIL then qrcode.QRCODE.Save (f,picture.SaveAsJPEG,100) end if You could add this in the Code:if qrcode.Create_QR then _________________ For great Music got to my podcast Website!!! http://podcast.1945mf-china.com Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
