美文网首页
Save WPF Ink Strokes To a Databa

Save WPF Ink Strokes To a Databa

作者: 虫虫侠教育 | 来源:发表于2019-03-10 17:40 被阅读0次

保存:

byte[] signature;

using(MemoryStream ms = newMemoryStream())

{

icSignature.Strokes.Save(ms);

signature = ms.ToArray();

}

stringsql = "INSERT INTO tblMyTable (mySigCol) VALUES (@Sig)";

SqlCommand comm = newSqlCommand(sql, conn);

comm.Parameters.AddWithValue("@Sig", signature);

comm.ExecuteNonQuery();

/////////////////////////////////////////////////////////////////////////

读取

stringsql = "SELECT TOP 1 mySigCol FROM tblMyTable";

SqlCommand comm = newSqlCommand(sql, conn);

byte[] signature = (byte[])comm.ExecuteScalar();

using(MemoryStream ms = newMemoryStream(signature))

{

icSignature.Strokes = newSystem.Windows.Ink.StrokeCollection(ms);

ms.Close();

}

相关文章

  • Save WPF Ink Strokes To a Databa

    保存: byte[] signature; using(MemoryStream ms = newMemorySt...

  • WPF简介

    目录 什么是WPF? WPF的历史? 为什么要用WPF及WPF作用 WPF与winForm区别? 什么是WPF? ...

  • 打卡第34天

    Not hammer-strokes but dance of the water sings the pebbl...

  • 【WPF】WPF介绍

    一、WPF简介 WPF:WPF即Windows Presentation Foundation,翻译为中文“Win...

  • 青花瓷英文版

    Your touch like brush strokes you hold colour in my skin ...

  • Have a cup with me

    Breeze comes from blue sea, Who strokes flowers with a ho...

  • Ink

    首先,要自我批评...昨天没有按量完成任务。。。 开心的是,达成了一大一小两个愿望,意外地去到离家很近的中医理疗馆...

  • Ink it!

    “As soon as you read, ink it.” - Mark Victor Hansen 好喜欢这短...

  • Ink

    Ink 一个方便的小部件,用于在[Material]小部件上绘制图像和其他装饰,以便[InkWell]和[InkR...

  • WPF/C#学习笔记.1:WPF中的布局TabControl,G

    WPF/C#学习笔记.1 WPF中的布局TabControl,Grid与GridSpliter等 WPF布局原则 ...

网友评论

      本文标题:Save WPF Ink Strokes To a Databa

      本文链接:https://www.haomeiwen.com/subject/jphppqtx.html