개정판 22b925fe
issue #0000 SymbolPrompt.xaml의 png OR svg select 제거
Change-Id: I2aed8d2881811410931c3c2ed2ab3ca5c15a0502
KCOM/Controls/SignManager.xaml.cs | ||
---|---|---|
207 | 207 |
} |
208 | 208 |
|
209 | 209 |
public StrokeCollection ConvertImageToStrokeCollection(BitmapImage image) |
210 |
{ |
|
210 |
{ |
|
211 |
// 이미지 크기 조정 |
|
212 |
int maxWidth = 900; |
|
213 |
int maxHeight = 200; |
|
214 |
double scaleX = (double)maxWidth / image.PixelWidth; |
|
215 |
double scaleY = (double)maxHeight / image.PixelHeight; |
|
216 |
double scale = Math.Min(scaleX, scaleY); |
|
217 |
|
|
218 |
TransformedBitmap resizedImage = new TransformedBitmap(image, new ScaleTransform(scale, scale)); |
|
219 |
|
|
211 | 220 |
InkCanvas inkCanvas = new InkCanvas(); |
212 |
inkCanvas.Width = image.Width;
|
|
213 |
inkCanvas.Height = image.Height;
|
|
221 |
inkCanvas.Width = resizedImage.Width;
|
|
222 |
inkCanvas.Height = resizedImage.Height;
|
|
214 | 223 |
|
215 | 224 |
// WriteableBitmap 생성 |
216 |
WriteableBitmap writeableBitmap = new WriteableBitmap(image);
|
|
225 |
WriteableBitmap writeableBitmap = new WriteableBitmap(resizedImage);
|
|
217 | 226 |
|
218 | 227 |
// 픽셀 데이터를 저장할 배열 생성 |
219 | 228 |
int stride = writeableBitmap.PixelWidth * (writeableBitmap.Format.BitsPerPixel / 8); |
... | ... | |
241 | 250 |
points.Add(new StylusPoint(x, y)); |
242 | 251 |
Stroke stroke = new Stroke(points); |
243 | 252 |
inkCanvas.Strokes.Add(stroke); |
253 |
|
|
254 |
System.Threading.Thread.SpinWait(10); |
|
244 | 255 |
} |
245 | 256 |
} |
246 | 257 |
} |
내보내기 Unified diff