@@ -70,10 +70,10 @@ public static ImageData GetImage(byte[] data, int width, int height, ImageData?
7070
7171 public static byte [ ] GetData ( SKTypeface font , int size , char c , int width , int height , int offsetx , int offsety )
7272 {
73- Debug . WriteLine ( $ "Font: { font . FamilyName } , Size: { size } , Char: { c } , Width: { width } , Height: { height } , OffsetX: { offsetx } , OffsetY: { offsety } ") ;
73+ // Debug.WriteLine($"Font: {font.FamilyName}, Size: {size}, Char: {c}, Width: {width}, Height: {height}, OffsetX: {offsetx}, OffsetY: {offsety}");
7474 //创建画布
7575 using var surface = SKSurface . Create ( new SKImageInfo ( width , height ) ) ;
76- Debug . WriteLine ( "Surface Created" ) ;
76+ // Debug.WriteLine("Surface Created");
7777 //创建画笔
7878 using var paint = new SKPaint
7979 {
@@ -83,21 +83,21 @@ public static byte[] GetData(SKTypeface font, int size, char c, int width, int h
8383 TextAlign = SKTextAlign . Center ,
8484 IsAntialias = true ,
8585 } ;
86- Debug . WriteLine ( "Paint Created" ) ;
86+ // Debug.WriteLine("Paint Created");
8787 //画布上画字
8888 surface . Canvas . DrawText ( c . ToString ( ) , width / 2 + offsetx , height - offsety , paint ) ;
89- Debug . WriteLine ( "Text Drawn" ) ;
89+ // Debug.WriteLine("Text Drawn");
9090 //获取像素数据
9191 IntPtr data = surface . PeekPixels ( ) . GetPixels ( ) ;
92- Debug . WriteLine ( "Pixels Get" ) ;
92+ // Debug.WriteLine("Pixels Get");
9393 var result = new byte [ width * height ] ;
9494
9595 // 获取像素数据
9696 using var pixmap = surface . PeekPixels ( ) ;
97- Debug . WriteLine ( "pixmap got" ) ;
97+ // Debug.WriteLine("pixmap got");
9898 if ( pixmap != null )
9999 {
100- Debug . WriteLine ( "get data" ) ;
100+ // Debug.WriteLine("get data");
101101 // 遍历像素数据
102102 for ( int y = 0 ; y < pixmap . Height ; y ++ )
103103 {
@@ -110,7 +110,7 @@ public static byte[] GetData(SKTypeface font, int size, char c, int width, int h
110110 }
111111 }
112112 }
113- Debug . WriteLine ( "Data got" ) ;
113+ // Debug.WriteLine("Data got");
114114
115115 return result ;
116116 }
0 commit comments