日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Excel行高与像素值,列宽与像素值之间的转换,绘制Excel像素画。

發布時間:2023/12/14 编程问答 50 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Excel行高与像素值,列宽与像素值之间的转换,绘制Excel像素画。 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
private static float GetDpiX() {try{using (Bitmap image = new Bitmap(1, 1)){using (Graphics graphics = Graphics.FromImage(image)){return graphics.DpiX;}}}catch{return 72;} }

傳入像素numPixel

int numPixel = (int)numericUpDown1.Value; Bitmap image = ConvertToFormat(fileImage.Image, PixelFormat.Format24bppRgb); //Bitmap image = (Bitmap)fileImage.Image; g = pictureBox1.CreateGraphics();double rowHeight = (double)((float)numPixel * 72f / (float)GetDpiX());for (int i = 0; i < 100; i++) {double colWidth = Math.Round((numPixel < 12 ? (numPixel / 12.00) : (1 + ((numPixel - 12) / 7.00))), 2);int _numPixel = (int)Math.Round(colWidth < 1 ? colWidth * 12.0 : 12 + (colWidth - 1) * 7.00); Console.WriteLine(string.Format($"{numPixel} {colWidth} {_numPixel}"));numPixel = numPixel + 1;//double width = (double)((float)numPixel * 72f / (float)GetDpiX()); }

?打印出100個與excel里面對比

?

10.08
20.17
30.25
40.33
50.42
60.5
70.58
80.67
90.75
100.83
110.92
121
131.14
141.29
151.43
161.57
171.71
181.86
192
202.14
212.29
222.43
232.57
242.71
252.86
263
273.14
283.29
293.43
303.57
313.71
323.86
334
344.14
354.29
364.43
374.57
384.71
394.86
405
415.14
425.29
435.43
445.57
455.71
465.86
476
486.14
496.29
506.43
516.57
526.71
536.86
547
557.14
567.29
577.43
587.57
597.71
607.86
618
628.14
638.29
648.43
658.57
668.71
678.86
689
699.14
709.29
719.43
729.57
739.71
749.86
7510
7610.14
7710.29
7810.43
7910.57
8010.71
8110.86
8211
8311.14
8411.29
8511.43
8611.57
8711.71
8811.86
8912
9012.14
9112.29
9212.43
9312.57
9412.71
9512.86
9613
9713.14
9813.29
9913.43
10013.57

總結

以上是生活随笔為你收集整理的Excel行高与像素值,列宽与像素值之间的转换,绘制Excel像素画。的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。