public static string AddColor(CColor ccolor) { double dblIpeRed = Convert.ToDouble(ccolor.intRed) / 255; double dblIpeGreen = Convert.ToDouble(ccolor.intGreen) / 255; double dblIpeBlue = Convert.ToDouble(ccolor.intBlue) / 255; return(dblIpeRed + " " + dblIpeGreen + " " + dblIpeBlue); }
public static string GetStrokeStarting(CColor StrokeColor, string strWidth = "normal", string strDash = "normal", CColor FillColor = null) { string str = "<path stroke=\"" + AddColor(StrokeColor) + "\" "; if (FillColor != null) { str += "fill=\"" + AddColor(FillColor) + "\" "; } str += "pen=\"" + strWidth + "\" dash=\"" + strDash + "\">\n"; return(str); }
public static string DrawIpt(IPoint ipt, IEnvelope pEnvelopeLayer, CEnvelope pEnvelopeIpe, string strShape, CColor StrokeColor, string strWidth = "normal") { double dblFactor = pEnvelopeIpe.Height / pEnvelopeLayer.Height; double dblx = CGeoFunc.CoordinateTransform( ipt.X, pEnvelopeLayer.XMin, pEnvelopeIpe.XMin, dblFactor); double dbly = CGeoFunc.CoordinateTransform( ipt.Y, pEnvelopeLayer.YMin, pEnvelopeIpe.YMin, dblFactor); return(drawIpeMark(dblx, dbly, strShape, AddColor(StrokeColor), strWidth)); }
/// <summary> /// /// </summary> /// <param name="StrokeColor"></param> /// <param name="strWidth">normal, heavier, fat, ultrafat</param> /// <param name="strDash">normal, dashed, dotted, dash dotted, dash dot dotted</param> /// <param name="cap">normal: butt; 0: butt; 1: round; 2: square</param> /// <param name="join">normal: round; 0: miter; 1: round; 2: bevel</param> /// <param name="FillColor"></param> /// <returns></returns> public static string GetStrokeStarting(CColor StrokeColor, string strWidth = "normal", string strDash = "normal", string cap = "normal", string join = "normal", CColor FillColor = null) { string str = "<path stroke=\"" + AddColor(StrokeColor) + "\""; if (FillColor != null) { str += "fill=\"" + AddColor(FillColor) + "\""; } str += AddOtherAttributes(strWidth, strDash, cap, join) + ">\n"; return(str); }
public static string DrawCpl(CPolyline cpl, IEnvelope pEnvelopeLayer, CEnvelope pEnvelopeIpe, CColor StrokeColor, string strWidth = "normal") { double dblFactor = pEnvelopeIpe.Height / pEnvelopeLayer.Height; var cptlt = cpl.CptLt; string str = GetStrokeStarting(StrokeColor, strWidth, "normal", "1", "1", null); str += AddCoordinates(cptlt, pEnvelopeLayer, pEnvelopeIpe, dblFactor); str += "</path>\n"; return(str); }
public static string DrawCpgBound(CPolygon cpg, IEnvelope pEnvelopeLayer, CEnvelope pEnvelopeIpe, CColor StrokeColor, string strWidth = "normal", string strDash = "normal") { double dblFactor = pEnvelopeIpe.Height / pEnvelopeLayer.Height; string str = GetStrokeStarting(StrokeColor, strWidth, strDash, "1", "1"); str += AddCoordinates(cpg.CptLt, pEnvelopeLayer, pEnvelopeIpe, dblFactor); //draw holes and fill wholes with white if (cpg.HoleCpgLt != null && cpg.HoleCpgLt.Count > 0) { foreach (var holecpg in cpg.HoleCpgLt) { str += AddCoordinates(holecpg.CptLt, pEnvelopeLayer, pEnvelopeIpe, dblFactor); if (holecpg.HoleCpgLt != null && holecpg.HoleCpgLt.Count > 0) { throw new ArgumentOutOfRangeException("We didn't consider this case!"); } } } str += "</path>\n"; return(str); }