先看这段调用标尺代码,请问是C#还是JS? 源码下载
//创建GoldPrinterRuler的实例ruler
var ruler = new GoldPrinter.Drawing.GoldPrinterRuler();
//这以下这个矩形区,就像是A4纸一样,可画水平、垂直标尺
ruler.X = 10;
ruler.Y = 20;
ruler.Width = 827;
ruler.Height = 1169;
//标尺主体颜色
ruler.Color = ruler.GetColorFrom("red");
//标尺主线颜色
ruler.LineColor = ruler.GetColorFrom("#FF0000");;
//标尺可以选水平Horizontal、垂直Vertical、两者Both
ruler.Direction = GoldPrinter.Drawing.RulerDirection.Both;
//标尺刻度线颜色,分别为最小刻度、0.5、1的刻度线颜色
ruler.ColorScaleOne = ruler.GetColorFrom("yellow");
ruler.ColorScaleFive = ruler.GetColorFrom("#00FF00");
ruler.ColorScaleTen = ruler.GetColorFrom("0,0,255");
//透明度,1-70,在画布上量时,别把被量物体遮住看不到了:)
ruler.Transparence = 30;
//标尺本身高,如果只显示刻度,用5就可以
ruler.Depth = 40;
//清空画布,并画一个尺子
ruler.Draw("goldPrinterCanvas");