本文整理汇总了C#中ZedGraph.FontSpec类的典型用法代码示例。如果您正苦于以下问题:C# FontSpec类的具体用法?C# FontSpec怎么用?C# FontSpec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FontSpec类属于ZedGraph命名空间,在下文中一共展示了FontSpec类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Label
/// <summary>
/// Constructor that builds a <see cref="Label" /> from a text <see cref="string" />
/// and a <see cref="FontSpec" /> instance.
/// </summary>
/// <param name="text"></param>
/// <param name="fontSpec"></param>
public Label(string text, FontSpec fontSpec)
{
_text = (text == null) ? string.Empty : text;
_fontSpec = fontSpec;
_isVisible = true;
}
示例2: FontSpec
/// <summary>
/// The Copy Constructor
/// </summary>
/// <param name="rhs">The FontSpec object from which to copy</param>
public FontSpec( FontSpec rhs )
{
_fontColor = rhs.FontColor;
_family = rhs.Family;
_isBold = rhs.IsBold;
_isItalic = rhs.IsItalic;
_isUnderline = rhs.IsUnderline;
_fill = rhs.Fill.Clone();
_border = rhs.Border.Clone();
_isAntiAlias = rhs._isAntiAlias;
_stringAlignment = rhs.StringAlignment;
_angle = rhs.Angle;
_size = rhs.Size;
_isDropShadow = rhs._isDropShadow;
_dropShadowColor = rhs._dropShadowColor;
_dropShadowAngle = rhs._dropShadowAngle;
_dropShadowOffset = rhs._dropShadowOffset;
_scaleFactor = rhs._scaleFactor;
_scaledSize = rhs._scaledSize;
Remake( 1.0F, _size, ref _scaledSize, ref _font );
}
示例3: Scale
/// <summary>
/// Basic constructor -- requires that the <see cref="Scale" /> object be intialized with
/// a pre-existing owner <see cref="Axis" />.
/// </summary>
/// <param name="ownerAxis">The <see cref="Axis" /> object that is the owner of this
/// <see cref="Scale" /> instance.</param>
public Scale( Axis ownerAxis )
{
_ownerAxis = ownerAxis;
_min = 0.0;
_max = 1.0;
_majorStep = 0.1;
_minorStep = 0.1;
_exponent = 1.0;
_mag = 0;
_baseTic = PointPair.Missing;
_minGrace = Default.MinGrace;
_maxGrace = Default.MaxGrace;
_minAuto = true;
_maxAuto = true;
_majorStepAuto = true;
_minorStepAuto = true;
_magAuto = true;
_formatAuto = true;
_isReverse = Default.IsReverse;
_isUseTenPower = true;
_isPreventLabelOverlap = true;
_isVisible = true;
_isSkipFirstLabel = false;
_isSkipLastLabel = false;
_isSkipCrossLabel = false;
_majorUnit = DateUnit.Day;
_minorUnit = DateUnit.Day;
_format = null;
_textLabels = null;
_isLabelsInside = Default.IsLabelsInside;
_align = Default.Align;
_alignH = Default.AlignH;
_fontSpec = new FontSpec(
Default.FontFamily, Default.FontSize,
Default.FontColor, Default.FontBold,
Default.FontUnderline, Default.FontItalic,
Default.FillColor, Default.FillBrush,
Default.FillType );
_fontSpec.Border.IsVisible = false;
_labelGap = Default.LabelGap;
}
示例4: PointAnnotation
public PointAnnotation( string label )
{
Label = label;
ExtraAnnotation = null;
FontSpec = new FontSpec();
}
示例5: Legend
/// <summary>
/// The Copy Constructor
/// </summary>
/// <param name="rhs">The XAxis object from which to copy</param>
public Legend( Legend rhs )
{
rect = rhs.Rect;
position = rhs.Position;
isHStack = rhs.IsHStack;
isVisible = rhs.IsVisible;
this.location = (Location) rhs.Location;
this.border = (Border) rhs.Border.Clone();
this.fill = (Fill) rhs.Fill.Clone();
fontSpec = (FontSpec) rhs.FontSpec.Clone();
}
示例6: Init
private void Init( string text )
{
if ( text != null )
_text = text;
else
text = "Text";
_fontSpec = new FontSpec(
Default.FontFamily, Default.FontSize,
Default.FontColor, Default.FontBold,
Default.FontItalic, Default.FontUnderline );
//this.isWrapped = Default.IsWrapped ;
_layoutArea = new SizeF( 0, 0 );
}
示例7: GetDotProductsPointSize
private int? GetDotProductsPointSize(Graphics g)
{
for (int pointSize = (int) Settings.Default.AreaFontSize; pointSize > 4; pointSize--)
{
var fontLabel = new FontSpec {Size = pointSize};
var sizeLabel = fontLabel.MeasureString(g, DotpLabelText, CalcScaleFactor());
float labelWidth = (float) XAxis.Scale.ReverseTransform((XAxis.Scale.Transform(0) + sizeLabel.Width));
if (labelWidth < 1.2)
return pointSize;
}
return null;
}
示例8: cp_gra_Click
/////////////////////////////////////////////////////
//plot Cp graph./////////////////////////////////////
//error code 013.////////////////////////////////////
private void cp_gra_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrEmpty(cppath)) //judge the cppath string is null or empty.
{
MessageBox.Show("请选择要显示的Cp文件夹或者其中的任意文件,或者开始新的计算。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
string foilname = null;
string restatus = null; //Reynold's number status.
string aoastatus = null; //angle of attack status.
string mastatus = null; //Mach number status.
string xtrstatus = null; //xtr status.
string title = null; //title for differ data.
FileStream cpfile = null;
if ((!string.IsNullOrEmpty(cppath)) && (!string.IsNullOrEmpty(foilpath)))
{
int ifoil = foilpath.LastIndexOf(".");
int jfoil = foilpath.LastIndexOf("\\");
foilname = foilpath.Substring(jfoil + 1, ifoil - jfoil - 1);
cpfile = new FileStream(cppath, FileMode.Open, FileAccess.Read);
int ialfa = cppath.LastIndexOf("_A");
int ima = cppath.LastIndexOf("_Ma");
int jma = cppath.LastIndexOf(".");
aoastatus = cppath.Substring(ialfa + 2, ima - ialfa - 2); //read in aoa status.
mastatus = cppath.Substring(ima + 3, jma - ima - 3); //read in ma status.
title = foilname + "@α " + aoastatus + "@Ma " + mastatus;
DirectoryInfo dirr = new DirectoryInfo(cppath.Substring(0, cppath.LastIndexOf("\\") + 1));
FileInfo[] ff = dirr.GetFiles();
foreach (FileInfo f in ff)
{
if (f.FullName.IndexOf("deployment.cfg") >= 0) //read in re status and xtr status.
{
FileStream cfgfile = new FileStream(f.FullName, FileMode.Open, FileAccess.Read);
StreamReader cfgreader = new StreamReader(cfgfile);
string content = cfgreader.ReadLine();
if (!string.IsNullOrEmpty(content)) //if there is a string, it must be Reynold's atatus.
{
restatus = content;
title = title + "Re " + restatus;
}
content = cfgreader.ReadLine();
if (!string.IsNullOrEmpty(content)) //if there is another line of string, it must be xtr status.
{
xtrstatus = content;
title = title + "xtr " + xtrstatus;
}
cfgreader.Close();
cfgfile.Close();
}
}
}
StreamReader reader = new StreamReader(cpfile);
List<List<double>> listcp = new List<List<double>>();
string temp = null;
GraphPane cppane = gra.GraphPane;
gra.GraphPane.CurveList.Clear();
reader.ReadLine();
while (!string.IsNullOrEmpty(temp = reader.ReadLine()))
{
string[] cpArr = temp.Trim().Split(' ');
List<double> templist = new List<double>();
foreach (string s in cpArr)
{
if (!string.IsNullOrEmpty(s))
{
templist.Add(double.Parse(s));
}
}
listcp.Add(templist);
}
reader.Close();
cpfile.Close();
double[] X = new double[listcp.Count];
double[] Y = new double[listcp.Count];
for (int i = 0; i < listcp.Count; i++)
{
X[i] = listcp[i][0];
Y[i] = listcp[i][1];
}
cppane.Title.Text = "Cp Graph";
cppane.XAxis.Title.Text = "Chord location";
FontSpec font = new FontSpec("Times New Roman", 20, Color.Black, false, false, false);
cppane.Title.FontSpec = font;
cppane.XAxis.Title.FontSpec = font;
cppane.XAxis.Scale.MaxAuto = true;
cppane.XAxis.Scale.MinAuto = true;
cppane.YAxis.Scale.MaxAuto = true;
cppane.YAxis.Scale.MinAuto = true;
cppane.YAxis.Scale.IsReverse = true; //define reversed Y axis only for Cp graph.
cppane.YAxis.Title.Text = "Cp";
cppane.YAxis.Title.FontSpec = font;
//.........这里部分代码省略.........
示例9: TextObj
/// <summary>
/// The Copy Constructor
/// </summary>
/// <param name="rhs">The <see cref="TextObj"/> object from which to copy</param>
public TextObj( TextObj rhs )
: base(rhs)
{
_text = rhs.Text;
_fontSpec = new FontSpec( rhs.FontSpec );
}
示例10: SetDefaultFontSpec
private void SetDefaultFontSpec(FontSpec fontSpec)
{
fontSpec.Family = "Verdana";
fontSpec.Size = 11f * _dpiFactor;
fontSpec.IsBold = false;
}
示例11: CreateGraphPane
/// <summary>
/// Create a new graph pane
/// </summary>
public GraphPane CreateGraphPane(string name)
{
GraphPane pane = new GraphPane(); //Here I create a new pane to stack charts?
FontSpec _fontTitle = new FontSpec("Arial", 12, Color.Black, true, false, false);
FontSpec _fontChart = new FontSpec("Arial", 10, Color.Black, false, false, false);
FontSpec _fontLegend = new FontSpec("Arial", 10, Color.Black, false, false, false);
_fontTitle.Border.IsVisible = false; _fontTitle.Border.Color = Color.Transparent;
_fontChart.Border.IsVisible = false; _fontChart.Border.Color = Color.Transparent;
_fontLegend.Border.IsVisible = false; _fontLegend.Border.Color = Color.Transparent;
pane.Border.IsVisible = false;
pane.Chart.IsRectAuto = true;
pane.Chart.Border.Width = 1;
int titleIndex = DrawTitle(ref pane, name, 0.5, 0.15, 13);
pane.Title.FontSpec = _fontTitle;
//X axis
pane.XAxis.Title.IsVisible = false;
pane.XAxis.Title.Text = "Time";
pane.XAxis.Title.FontSpec = _fontChart;
pane.XAxis.Scale.FontSpec = _fontChart;
pane.XAxis.Color = Color.Black;
if (_startDate != new DateTime()) pane.XAxis.Scale.Min = _startDate.ToOADate();
if (_endDate != new DateTime()) pane.XAxis.Scale.Max = _endDate.ToOADate();
//pane.XAxis.CrossAuto = true;
pane.XAxis.MajorGrid.IsVisible = true;
pane.XAxis.Scale.MajorStepAuto = true;
pane.XAxis.Type = AxisType.Date;
pane.XAxis.Scale.Format = "yyyy-MM-dd";
//Y axis
pane.YAxis.Title.IsVisible = false;
pane.YAxis.MajorGrid.IsVisible = true;
pane.Y2Axis.Title.FontSpec = _fontChart;
pane.Y2Axis.Scale.FontSpec = _fontChart;
pane.YAxis.Title.FontSpec = _fontChart;
pane.YAxis.Scale.FontSpec = _fontChart;
pane.YAxis.Color = Color.Black;
pane.Chart.Fill = new Fill(Color.White);
pane.LineType = LineType.Stack;
//Set the legend:
pane.Legend.Position = LegendPos.InsideBotRight;
pane.Legend.FontSpec = _fontLegend;
pane.Legend.Border.IsVisible = false;
return pane;
}
示例12: Init
private void Init( string text )
{
if ( text != null )
this.text = text;
else
text = "Text";
this.fontSpec = new FontSpec(
Default.FontFamily, Default.FontSize,
Default.FontColor, Default.FontBold,
Default.FontItalic, Default.FontUnderline );
}
示例13: TextItem
/// <summary>
/// The Copy Constructor
/// </summary>
/// <param name="rhs">The <see cref="TextItem"/> object from which to copy</param>
public TextItem( TextItem rhs )
: base(rhs)
{
text = rhs.Text;
fontSpec = new FontSpec( rhs.FontSpec );
}
示例14: foil_gra_Click
////////////////////////////////////////////////////////
//plot airfoil graph.///////////////////////////////////
//error code 012.///////////////////////////////////////
private void foil_gra_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrEmpty(foilpath)) //judge the foilpath string is null or empty.
{
MessageBox.Show("请选择要显示的翼型数据文件夹或者其中的任意文件,或者开始新的计算。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
FileStream foilfile = null; //declare airfoil file filestream.
string foilname = null; //declare airfoil name string.
if (!string.IsNullOrEmpty(foilpath))
{
int l = foilpath.LastIndexOf(".");
int m = foilpath.LastIndexOf("\\");
foilname = foilpath.Substring(m + 1, l - m - 1); //get the airfoil name.
foilfile = new FileStream(foilpath, FileMode.Open, FileAccess.Read);
}
StreamReader reader = new StreamReader(foilfile);
List<List<double>> listXY = new List<List<double>>();
string coor = null;
GraphPane foilpane = gra.GraphPane;
gra.GraphPane.CurveList.Clear();
reader.ReadLine();
while (!string.IsNullOrEmpty(coor = reader.ReadLine()))
{
string[] foilArr = coor.Trim().Split(new char[] { '\t', ' ' });
List<double> templist = new List<double>();
foreach (string s in foilArr)
{
if (!string.IsNullOrEmpty(s))
{
templist.Add(double.Parse(s));
}
}
listXY.Add(templist);
}
reader.Close();
foilfile.Close();
double[] X = new double[listXY.Count];
double[] Y = new double[listXY.Count];
for (int i = 0; i < listXY.Count; i++)
{
X[i] = listXY[i][0];
Y[i] = listXY[i][1];
}
foilpane.Title.Text = "Airfoil";
foilpane.XAxis.Title.Text = "Chord Location";
foilpane.YAxis.Title.Text = "Deep Location";
FontSpec font = new FontSpec("Times New Roman", 20, Color.Black, false, false, false);
foilpane.Title.FontSpec = font;
foilpane.XAxis.Title.FontSpec = font;
foilpane.YAxis.Title.FontSpec = font;
foilpane.YAxis.Scale.Max = 0.48; //define the graph axis scale.
foilpane.YAxis.Scale.Min = -0.48;
foilpane.XAxis.Scale.Max = 1.2;
foilpane.XAxis.Scale.Min = -0.2;
foilpane.YAxis.Scale.IsReverse = false; //Y axis is not reversed.
LineItem foilcurve = foilpane.AddCurve(foilname, X, Y, Color.Red, SymbolType.None);
gra.AxisChange();
gra.Refresh();
}
catch (System.Exception ex)
{
MessageBox.Show("请查看帮助文档或者将错误信息告知:\r\nE-Mail:[email protected]\r\nEC:012", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
示例15: polar_gra_Click
//.........这里部分代码省略.........
}
}
listp.Add(pararow);
}
}
reader.Close();
outdatafile.Close();
}
if (f.FullName.IndexOf("deployment.cfg") >= 0) //read in re status and xtr status.
{
FileStream cfgfile = new FileStream(f.FullName, FileMode.Open, FileAccess.Read);
StreamReader cfgreader = new StreamReader(cfgfile);
string content = cfgreader.ReadLine();
if (!string.IsNullOrEmpty(content))
{
restatus = "@Re " + content;
}
content = cfgreader.ReadLine();
if (!string.IsNullOrEmpty(content))
{
xtrstatus = "@xtr " + content;
}
cfgreader.Close();
cfgfile.Close();
}
}
if (listp[0][3] == 0)
{
return;
}
double tempma = listp[0][0];
mastatus.Add(Convert.ToString(tempma));
List<int> maflag = new List<int>();
for (int ima = 1; ima < listp.Count; ima++)
{
if (!(listp[ima][0] == tempma)) //differ differential ma.
{
maflag.Add(ima); //the next different ma position in listp.
tempma = listp[ima][0];
mastatus.Add(Convert.ToString(tempma));
}
}
maflag.Add(listp.Count);
if (mastatus.Count > 9) //if the count of Mach number greater than ten, the graph couldn't display.
{
MessageBox.Show("请保证一次计算的不同马赫数数量不大于10个,否则图形无法显示", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
polarpane.Title.Text = "Polar Graph";
polarpane.XAxis.Title.Text = "Cd";
polarpane.YAxis.Title.Text = "Cl";
FontSpec font = new FontSpec("Times New Roman", 20, Color.Black, false, false, false);
polarpane.Title.FontSpec = font;
polarpane.XAxis.Title.FontSpec = font;
polarpane.YAxis.Title.FontSpec = font;
polarpane.YAxis.Scale.IsReverse = false;
polarpane.XAxis.Scale.MaxAuto = true;
polarpane.XAxis.Scale.MinAuto = true;
polarpane.YAxis.Scale.MaxAuto = true;
polarpane.YAxis.Scale.MinAuto = true;
for (int i = 0; i < mastatus.Count; i++)
{
if (i == 0) //output the first line.
{
double[] X = new double[maflag[0]];
double[] Y = new double[maflag[0]];
for (int i0 = 0; i0 < maflag[0]; i0++)
{
X[i0] = listp[i0][3];
Y[i0] = listp[i0][2];
}
title.Add(foilname + "@Ma " + mastatus[0] + restatus + xtrstatus);
LineItem polarcurve = polarpane.AddCurve(title[0], X, Y, color[0], symbol[0]);
gra.AxisChange();
gra.Refresh();
}
else //output other line using different method.
{
double[] X = new double[maflag[i] - maflag[i - 1]];
double[] Y = new double[maflag[i] - maflag[i - 1]];
for (int i1 = maflag[i - 1]; i1 < maflag[i]; i1++)
{
X[i1 - maflag[i - 1]] = listp[i1][3];
Y[i1 - maflag[i - 1]] = listp[i1][2];
}
title.Add(foilname + "@Ma " + mastatus[i] + restatus + xtrstatus);
LineItem polarcurve = polarpane.AddCurve(title[i], X, Y, color[i], symbol[i]);
gra.AxisChange();
gra.Refresh();
}
}
}
catch (System.Exception ex)
{
MessageBox.Show("请查看帮助文档。\r\nEC:016", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}