개정판 58dd9e89
Fix: 스탬의 COMPANY_NAME이 실제 회사 이름으로 대체도지 않는 오류 수정
Change-Id: Ief8011c7d7ce974f1881907911f45c8c446a7e98
KCOM/Controls/SignManager.xaml.cs | ||
---|---|---|
34 | 34 |
private async void SignManager_Loaded(object sender, RoutedEventArgs e) |
35 | 35 |
{ |
36 | 36 |
var strokeData = await ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseTaskClient.GetSignStrokesAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID); |
37 |
|
|
38 | 37 |
if(strokeData != null) |
39 | 38 |
{ |
40 | 39 |
StringToStroke(strokeData); |
... | ... | |
51 | 50 |
|
52 | 51 |
private async void Save_Click(object sender, RoutedEventArgs e) |
53 | 52 |
{ |
54 |
//if (KCOM.VistaSecurity.IsAdmin()) |
|
55 |
//{ |
|
56 |
|
|
57 | 53 |
if (SignCanvas.Strokes.Count > 0) |
58 | 54 |
{ |
59 |
|
|
60 | 55 |
var signImage = Convert.ToBase64String(SignatureToBitmapBytes()); |
61 | 56 |
|
62 | 57 |
var pointes = SignCanvas.Strokes.Select(x => x.GetBounds()); |
... | ... | |
91 | 86 |
//SetPreview(signData); |
92 | 87 |
} |
93 | 88 |
}; |
94 |
//} |
|
95 |
//else |
|
96 |
//{ |
|
97 |
// MessageBox.Show("어드민 권한 필요"); |
|
98 |
//} |
|
99 | 89 |
} |
100 | 90 |
|
101 | 91 |
private void SetPreview(string imgStr) |
... | ... | |
120 | 110 |
} |
121 | 111 |
} |
122 | 112 |
|
113 |
/// <summary> |
|
114 |
/// Sign을 비트맵으로 변환하여 리턴한다. |
|
115 |
/// </summary> |
|
116 |
/// <returns></returns> |
|
123 | 117 |
private byte[] SignatureToBitmapBytes() |
124 | 118 |
{ |
125 | 119 |
RenderTargetBitmap rtb = new RenderTargetBitmap((int)SignCanvas.ActualWidth, (int)SignCanvas.ActualHeight, 96d, 96d, PixelFormats.Default); |
126 | 120 |
rtb.Render(SignCanvas); |
127 | 121 |
|
128 |
MemoryStream ms = new MemoryStream(); |
|
129 |
System.Windows.Media.Imaging.PngBitmapEncoder encoder = new PngBitmapEncoder(); |
|
130 |
BitmapFrame frame = BitmapFrame.Create(rtb); |
|
131 |
encoder.Frames.Add(frame); |
|
132 |
encoder.Save(ms); |
|
122 |
byte[] bytes = null; |
|
123 |
using (MemoryStream ms = new MemoryStream()) |
|
124 |
{ |
|
125 |
System.Windows.Media.Imaging.PngBitmapEncoder encoder = new PngBitmapEncoder(); |
|
126 |
BitmapFrame frame = BitmapFrame.Create(rtb); |
|
127 |
encoder.Frames.Add(frame); |
|
128 |
encoder.Save(ms); |
|
133 | 129 |
|
134 |
ms.Position = 0; |
|
130 |
ms.Position = 0;
|
|
135 | 131 |
|
136 |
byte[] bytes = new byte[ms.Length]; |
|
137 |
ms.Read(bytes, 0, bytes.Length); |
|
132 |
bytes = new byte[ms.Length]; |
|
133 |
ms.Read(bytes, 0, bytes.Length); |
|
134 |
} |
|
138 | 135 |
|
139 | 136 |
return bytes; |
140 | 137 |
} |
... | ... | |
178 | 175 |
{ |
179 | 176 |
try |
180 | 177 |
{ |
181 |
|
|
182 | 178 |
//deserialize it |
183 | 179 |
BinaryFormatter bf = new BinaryFormatter(); |
184 | 180 |
MemoryStream ms = new MemoryStream(Convert.FromBase64String(strokesData)); |
내보내기 Unified diff