AODL.Document.Export.Html.HTMLContentBuilder.GetGraphicAsHtml C# (CSharp) Метод

GetGraphicAsHtml() публичный Метод

Gets the graphic as HTML.
public GetGraphicAsHtml ( Graphic graphic ) : string
graphic AODL.Document.Content.Draw.Graphic The graphic.
Результат string
		public string GetGraphicAsHtml(Graphic graphic)
		{
			//standard space around 12px
			string html					= "<img hspace=\"12\" vspace=\"12\" ";

			try
			{
				if (graphic != null)
				{
					if (graphic.HRef != null)
						html			+= "src=\""+this.GraphicTargetFolder+"/"+graphic.HRef+"\" ";
					
					string graphStyle	= "";
					if (graphic.Frame != null)
						graphStyle		= this.HTMLStyleBuilder.GetFrameStyleAsHtml(graphic.Frame);
					if (graphStyle.Length > 0)
						html			+= graphStyle+" ";

					//Image map?
					if (this._nextImageMapName != null)
						html			+= "usemap=\"#"+this._nextImageMapName+"\"";

					html				+= ">\n";
				}
			}
			catch(Exception ex)
			{
				throw new AODLException("Exception while trying to build a HTML string from a Graphic object.", ex);
			}

			if (!html.Equals("<img "))
				html				+= "</img>\n";
			else
				html				= "";

			return html;
		}