
验证码框框,是怎么做的?密密麻麻那些
------解决思路----------------------
图片生成的。
------解决思路----------------------
绘制的 line与点
------解决思路----------------------
用image 控件
Source 用位图..
------解决思路----------------------
<Image x:Name="img" HorizontalAlignment="Left" VerticalAlignment="Top" Width="320" Height="240" Source="{Binding Iimg}" Margin="263,0,0,0"/>
//byts是位图,数据,如PNG格式的数据
var ms = new System.IO.MemoryStream(byts);
BitmapImage source = new BitmapImage();
source.BeginInit();
source.StreamSource = ms;
source.EndInit();
img.ImageSource=source
------解决思路----------------------
动态绘制的。
循环绘制点和线,每次都随机位置。
------解决思路----------------------
如楼上的代码。
大概思路:
1、生成一张空白Bitmap图片
2、循环绘制验证码数字(如4个数字,则循环4次,位置和旋转角度随机)
3、往图片上随机绘制点和线(循环次数自定,位置随机)
4、直接在Image控件显示