-
[C#] 열화상 이미지에 온도데이터 표출C#/WPF_예제소스 2022. 4. 26. 17:15
var visual = new DrawingVisual(); using (DrawingContext drawingContext = visual.RenderOpen()) { //drawingContext.DrawImage(bitmapSource, new Rect(0, 0, 256, 256)); drawingContext.DrawImage(wb, new Rect(0, 0, 600, 600)); //wb 비트맵 인스턴스 //ex) WriteableBitmap wb = new WriteableBitmap(iWx, iHy, 96, 96, PixelFormats.Bgra32, null); for (y = 0; y < iHy; y++) { for (x = 0; x < iWx; x++) { //string sTempData = string.Format("{0:D2}", allData[y, x]); string sTempData = allData[y, x].ToString().PadLeft(2, '0').Substring(0, 2); drawingContext.DrawText //온도데이터 string 출력 ( new FormattedText( sTempData, CultureInfo.InvariantCulture, FlowDirection.LeftToRight, new Typeface("Segoe UI"), (10/tadInterpolation.nInterpol), Brushes.Black ), new Point((double)(600*x)/ iWx, (600 * y) / iHy) ); } } } var image = new DrawingImage(visual.Drawing); imgThermal.Source = image;
728x90'C# > WPF_예제소스' 카테고리의 다른 글
[WPF]모눈종이 그리기 (0) 2022.06.29 [C#]Canvas to BitmapImage (0) 2022.05.24 [C#] Redirect WriteLine stream to a textblock (0) 2022.04.12 [C#]ColorMap (0) 2022.04.06 [C#]CSV파일 (0) 2022.03.30 댓글