silverlight 生成二维码
MainPage.xaml
<Grid x:Name="LayoutRoot" Background="White">
<Border BorderThickness="" BorderBrush="Black" />
<Grid ShowGridLines="True">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height=""/>
<RowDefinition Height=""/>
<RowDefinition Height=""/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width=""/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="二维码" Grid.Column="" Grid.Row="" TextAlignment="Center" Margin="10,50" />
<Image x:Name="imgCode" Grid.Column="" Grid.Row="" Margin=""/>
<TextBlock Text="图片大小" Grid.Column="" Grid.Row="" Margin="" TextAlignment="Center" />
<ComboBox x:Name="cmbSize" Grid.Column="" Grid.Row="" Width="" Height="" HorizontalAlignment="Right" Margin="0,10,100,10">
<ComboBoxItem Content="" IsSelected="True" />
<ComboBoxItem Content="" />
</ComboBox>
<TextBlock Text="二维码内容" Grid.Column="" Grid.Row="" TextAlignment="Center" Margin=""/>
<TextBox x:Name="txtContent" Height="" Margin="" Grid.Column="" Grid.Row="" />
<Button x:Name="btnAdd" Content="生成" Width="" Grid.Row="" Grid.Column="" Click="btnAdd_Click" Margin=""/>
</Grid>
</Grid>
MainPage.xaml.cs
public partial class MainPage : UserControl
{
StringBuilder sb = null;
Uri uri = null;
public MainPage()
{
InitializeComponent();
sb = new StringBuilder();
}
private void btnAdd_Click(object sender, RoutedEventArgs e)
{
sb.Append("http://chart.apis.google.com/chart?cht=qr&chs=");
sb.Append(((ComboBoxItem)cmbSize.SelectedItem).Content.ToString());
sb.Append("x");
sb.Append(((ComboBoxItem)cmbSize.SelectedItem).Content.ToString());
sb.Append("&chl=");
sb.Append(txtContent.Text);
uri = new Uri(sb.ToString());
imgCode.Source = new BitmapImage(uri);
sb.Clear();
}
}
silverlight 生成二维码的更多相关文章
- C#利用QrCode.Net生成二维码(Qr码)
在网上很多应用都是用二维码来分享网址或者其它的信息.尤其在移动领域,二维码更是有很大的应用场景.因为项目的需要,需要在网站中增加一个生成二维码分析网址的功能,在谷歌大幅度抽筋的情况下无奈使用百度.百度 ...
- C#利用QrCode.Net生成二维码(Qr码
http://www.cnblogs.com/Soar1991/archive/2012/03/30/2426115.html 现在网上很多应用都是用二维码来分享网址或者其它的信息.尤其在移动领域,二 ...
- Javascript生成二维码(QR)
网络上已经有非常多的二维码编码和解码工具和代码,很多都是服务器端的,也就是说需要一台服务器才能提供二维码的生成.本着对服务器性能的考虑,这种小事情都让服务器去做,感觉对不住服务器,尤其是对于大流量的网 ...
- 使用jquery.qrcode生成二维码(转)
jQuery 的 qrcode 插件就可以在浏览器端生成二维码图片. 这个插件的使用非常简单: 1.首先在页面中加入jquery库文件和qrcode插件. <script type=" ...
- iOS 生成二维码
首先先下载生成二维码的支持文件 libqrencode 添加依赖库 CoreGraphics.framework. QuartzCore.framework.AVFoundation.framewor ...
- QR code 扩展生成二维码
include './phpqrcode/phpqrcode.php'; //引入QR库 QRcode::png("leo", 'qrcode.png', 'L', 10); ...
- Python 创建本地服务器环境生成二维码
一. 需求 公司要做一个H5手机端适配页面,因技术问题所以H5是外包的,每次前端给我们源码,我们把源码传到服务器让其他人访问看是否存在bug,这个不是很麻烦吗?有人说,可以让前端在他们的服务器上先托管 ...
- C#通过第三方组件生成二维码(QR Code)和条形码(Bar Code)
用C#如何生成二维码,我们可以通过现有的第三方dll直接来实现,下面列出几种不同的生成方法: 1):通过QrCodeNet(Gma.QrCodeNet.Encoding.dll)来实现 1.1):首先 ...
- 使用Spire.Barcode程序库生成二维码
使用Spire.Barcode程序库生成二维码 某天浏览网页发现了一个二维码的程序库.它的描述说他可以扫描二维码图像.我很感兴趣,想试试他是不是会有用.所以我就用了些方法扫描二维码图像来测试一下.结果 ...
随机推荐
- 关于Android悬浮窗要获取按键响应的问题
要在Android中实现顶层的窗口弹出,一般都会用WindowsManager来实现,但是几乎所有的网站资源都是说弹出的悬浮窗不用接受任何按键响应. 而问题就是,我们有时候需要他响应按键,比如电视上的 ...
- tachyon 本地模式安装
本地模式不用考虑hadoop的版本,所以直接下载 binary 包或者自己编译 1.配置主机名.JDK.关闭防火墙.关闭Selinux.配置hosts ... ... 2.设置本机SSH免密码登陆 . ...
- BootStrap2学习日记18---提示消息
代码: <div class="alert alert-block" id="alert"> <a href="#" cl ...
- A + B Again
Problem Description There must be many A + B problems in our HDOJ , now a new one is coming.Give you ...
- 12. Android框架和工具之 StringUtils(字符串操作)
1. StringUtils介绍: StringUtils是apache commons lang库(http://commons.apache.org/proper/commons-lang/dow ...
- find 忽略文件夹选项-prune的说明
注意:因为习惯在当前路径查找时候,常忽略./ 的指定,但读者不要因此而完全忘记find的格式. 查找时忽略指定目录,是要使用-prune选项,但实际上最重要的还是要和path配合.-prune的意义是 ...
- 剑指Offer02 替换空格
/************************************************************************* > File Name: 02_Replac ...
- jQuery选择器之属性选择器Demo
测试代码: 06-属性选择器.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" &quo ...
- Differential Geometry之第三章曲面的局部理论
第三章.曲面的局部理论 1.曲面的概念 1.1.曲面的概念 1.2.切平面与法向 2.曲面的第一基本形式 3.曲面的第二基本形式 正定矩阵:一个n阶的实对称矩阵M是正定的的条件是当且仅当对于所有的非零 ...
- Lazy Makes Others Busy – a bad experience with DLL
The Story: Recently, I’m working as a deployment engineer at customer site with my team members. The ...