Skip to content

Instantly share code, notes, and snippets.

View ichengzi's full-sized avatar
🥇
coding...

chengzi ichengzi

🥇
coding...
View GitHub Profile
@ichengzi
ichengzi / Program.cs
Last active September 19, 2015 12:56
Xaml Console Printer
namespace XamlConsolePrinter
{
using System.Printing;
using System.Threading;
using System.Threading.Tasks;
using System.Threading.Tasks.Schedulers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Xps;
@ichengzi
ichengzi / Xaml Console Printer.cs
Created September 19, 2015 12:54
使用MergeAndValidatePrintTicket,VisualsToXpsDocument批量visual(网络搜集)
namespace XamlConsolePrinter
{
using System.Printing;
using System.Threading;
using System.Threading.Tasks;
using System.Threading.Tasks.Schedulers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Xps;
namespace NAMESPACE
{
public enum WindowsMessage
{
WM_NULL = 0x0000,
WM_CREATE = 0x0001,
WM_DESTROY = 0x0002,
WM_MOVE = 0x0003,
WM_SIZE = 0x0005,
WM_ACTIVATE = 0x0006,
@ichengzi
ichengzi / WPF- FontChooser.cs
Last active November 6, 2015 02:49
文字选择器:动态修改字体,大小,粗细等font属性
// http://stackoverflow.com/questions/11572636/set-value-to-fontdialog-in-wpf/11572921#11572921
// http://blogs.msdn.com/b/text/archive/2006/11/01/sample-font-chooser.aspx
// 微软官方博客的字体选择器例子
//WPF
System.Windows.Forms.FontDialog fontDialog = new System.Windows.Forms.FontDialog();
if (fontDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
FontFamilyConverter ffc = new FontFamilyConverter();
this.textAnnotation.FontSize = fontDialog.Font.Size;