개정판 a9a82876
issue #00000 export시 페이지 이미지 흐려지는 현상 수정
Change-Id: Ic8e9111a195008f0de03040d9dda92b486c0b778
KCOM/Events/Export.cs | ||
---|---|---|
158 | 158 |
return myImage; |
159 | 159 |
} |
160 | 160 |
|
161 |
public bool ExportingFile(Visual visual, double pageWidth, double pageHeight, string fileName)
|
|
161 |
public bool ExportingFile(Canvas visual, double pageWidth, double pageHeight, string fileName)
|
|
162 | 162 |
{ |
163 | 163 |
bool result = false; |
164 | 164 |
|
165 | 165 |
try |
166 | 166 |
{ |
167 |
RenderOptions.SetBitmapScalingMode(visual, BitmapScalingMode.HighQuality); |
|
167 | 168 |
JpegBitmapEncoder png = new JpegBitmapEncoder(); |
168 |
RenderTargetBitmap renderBitmap = new RenderTargetBitmap((int)pageWidth, (int)pageHeight, 96d, 96d, PixelFormats.Default);
|
|
169 |
png.QualityLevel = 100;
|
|
169 | 170 |
|
170 |
DrawingVisual drawingVisual = new DrawingVisual(); |
|
171 |
DrawingContext drawingContext = drawingVisual.RenderOpen(); |
|
172 |
VisualBrush visualBrush = new VisualBrush(visual); |
|
173 |
drawingContext.DrawRectangle(visualBrush, null, new System.Windows.Rect(new System.Windows.Point(0, 0), new System.Windows.Point(pageWidth, pageHeight))); |
|
174 |
drawingContext.Close(); |
|
171 |
double dpi = 96d; |
|
172 |
|
|
173 |
RenderTargetBitmap renderBitmap = new RenderTargetBitmap((int)pageWidth, (int)pageHeight, dpi, dpi, PixelFormats.Pbgra32); |
|
174 |
|
|
175 |
//DrawingVisual drawingVisual = new DrawingVisual(); |
|
176 |
//DrawingContext drawingContext = drawingVisual.RenderOpen(); |
|
177 |
////VisualBrush visualBrush = new VisualBrush(visual); |
|
178 |
//drawingContext.DrawRectangle(visual, null, new System.Windows.Rect(new System.Windows.Point(0, 0), new System.Windows.Point(pageWidth, pageHeight))); |
|
179 |
//drawingContext.Close(); |
|
175 | 180 |
|
176 |
renderBitmap.Render(drawingVisual);
|
|
181 |
renderBitmap.Render(visual);
|
|
177 | 182 |
png.Frames.Add(BitmapFrame.Create(renderBitmap)); |
178 | 183 |
|
179 | 184 |
using (FileStream fileStream = File.Create(fileName)) |
내보내기 Unified diff