设为首页 加入收藏

TOP

使用 Google 的 Web API 创建二维码(二)
2015-02-02 14:15:04 来源: 作者: 【 】 浏览:21
Tags:使用 Google Web API 创建 二维
As String
? ? ? ? Dim _qrAddr As String = _GOOGLE_URL.Replace("{WIDTH}", Me.Width.ToString).Replace("{HEIGHT}", Me.Height.ToString)
? ? ? ? _qrAddr = _qrAddr.Replace("{DATA}", WebUtility.UrlEncode(_DATA))
?
? ? ? ? Return _qrAddr
? ? End Function
?
? ? Protected Overrides Sub OnPaint(e As PaintEventArgs)
? ? ? ? MyBase.OnPaint(e)
? ? ? ? If _DATA Is Nothing Then Exit Sub
?
? ? ? ? Dim client As New WebClient()
? ? ? ? Dim bytes() As Byte = client.DownloadData(getQRURI())
? ? ? ? client.Dispose()
?
? ? ? ? Dim memStream As New IO.MemoryStream(bytes)
? ? ? ? Dim bmp As Bitmap = Bitmap.FromStream(memStream)
? ? ? ? memStream.Dispose()
?
? ? ? ? e.Graphics.DrawImage(bmp, 0, 0)
? ? End Sub
?
? ? Public Sub New()
? ? ? ? InitializeComponent()
? ? End Sub
End Class


我希望本文对你的项目有用。


祝你编码愉快,工作愉快!


英文原文:Create QR Codes with Google Web APIs


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇PHP代码优化24条真经 下一篇Java并发:分布式锁

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: