WinForm 標尺和網格

2021-05-10 12:53:58 字數 1270 閱讀 8257

using system;

using system.collections.generic;

using system.componentmodel;

using system.drawing;

using system.data;

using system.text;

using system.windows.forms;

namespace barcode

private void linearscale_paint(object sender, painteventargs e)

if (i % 10 == 0)

g.drawline(pens.black, start, end);}}

g.drawline(pens.black, new pointf(originlocation, originlocation), new pointf(this.width, originlocation));

//繪製y軸

for (int i = 0; i <= heightinmm; i++)

if (i % 10 == 0)

g.drawline(pens.black, start, end);}}

g.drawline(pens.black, new pointf(originlocation, originlocation), new pointf(originlocation, this.height));

g.fillrectangle(texturebrush, new rectangle(originlocation + (int)(settings.monitordpi / 25.4 * 1 * scaling) - offsetx, originlocation + (int)(settings.monitordpi / 25.4 * 1 * scaling) - offsetx, maxscalex - originlocation, maxscaley - originlocation));

if (showrec)

}public void offset(int offsetx, int offsety)

#region scaling

public float scaling

set}

#endregion

#region offset

public int offsetx

set}

public int offsety

set}

#endregion}}

WinForm 標尺和網格 改良版

using system using system.collections.generic using system.componentmodel using system.drawing using system.drawing.drawing2d using system.data using ...

WinForm畫網格並填充顏色

因為研究codecombat上的最後一題,自己嘗試分解題目,然後想到需要畫網格,還有最優化的方法 源 如下 using system using system.collections.generic using system.componentmodel using system.data usin...

顯示網格 Moldflow 網格劃分和處理

目前,moldflow 支援四種網格形式,即 midplane fusion solid 3d 和 beam,分別 是中性面網格 雙面流網格 實體網格和一維單元,如圖 10 2 所示。midplane 中性面 網格理論基於塑料熔體的粘度較大,而普通塑料製品的厚度一般遠 小於其他兩個方向 稱流動方向 ...