当前位置: 首页>>代码示例>>C#>>正文


C# RectangleF.ToString方法代码示例

本文整理汇总了C#中System.Drawing.RectangleF.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# RectangleF.ToString方法的具体用法?C# RectangleF.ToString怎么用?C# RectangleF.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Drawing.RectangleF的用法示例。


在下文中一共展示了RectangleF.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddText

		/// <summary>
		/// Methods directly produces DXF string for text of the Flowchart object
		/// </summary>
		/// <param name="TextID">Id of the text tag</param>
		/// <param name="rect">Text's rectangle</param>
		/// <param name="sText">Text string</param>
		/// <param name="crText">Text color</param>
		/// <param name="fnText">Text font</param>
		/// <param name="sft">Text format</param>
		/// <param name="Multiline">true if text is multi-lined</param>
		/// <param name="RA">Rotation angle of the text</param>
		/// <param name="IsArrowText">true if text is on arrow ( not used )</param>
		/// <returns>true if succesfull otherwise false</returns>
		public bool AddText(long TextID, RectangleF rect, string sText, Color crText, Font fnText, StringFormat sft, bool Multiline, float RA, bool IsArrowText)
		{
			string sResult = "";
		
			if ( sText == "" )
				return false;

			if ( sText == null )
				return false;


			if ( fnText == null )
				fnText = m_FlowChart.Font;

			try
			{
				if (IsArrowText)
					sft.FormatFlags = StringFormatFlags.FitBlackBox;

				if ( Multiline ) // If the is 'Multylined' producing MTEXT DXF output
				{
					sText = sText.Replace("\n"," ");
					sText = sText.Replace("\r"," ");

					/* USE IF YOU WANT TO SEE TEXT AREA AS RED FRAME
					AddRect(rect, TextID, Color.Red, Color.Transparent, Color.Transparent,DashStyle.Solid,
						"", null, null);
						*/
					sResult = String.Format(provider, "0\nMTEXT\n  100\nAcDbEntity\n{0:HAN} 8\n{15}\n  62\n{0:ACI}\n  100\nAcDbMText\n  10\n{1:U}\n  20\n{2:U}\n  40\n{10:U}\n  41\n{3:U}\n  71\n{4:SAL}\n  72\n{5}\n  1\n{6}{7:ATEXT}{8}{9}\n  7\n{14}\n  42\n{11:U}\n  43\n{12:U}\n  50\n{13}\n",
						crText, rect.Left + ((sft.Alignment==StringAlignment.Center) ? rect.Width/2 : 0f) , m_FlowChart.DocExtents.Height - ( rect.Top + rect.Height/2) , rect.Width , sft, "1" , "" ,  fnText , sText, "" , fnText.Size*0.6, rect.Width/2 , rect.Height/2, (-1)*RA , "Standard", TEXT_LAYER);
				}
				else // If the is not 'Multylined' producing TEXT DXF output
					sResult = String.Format(provider, "0\nTEXT\n  100\nAcDbEntity\n{0:HAN} 8\n{15}\n  62\n{0:ACI}\n  100\nAcDbText\n  10\n{1:U}\n  20\n{2:U}\n  40\n{10:U}\n  71\n{4}\n  1\n{6}{7:ATEXT}{8}{9}\n  41\n0.6\n 7\n{14}\n  50\n{13}\n  72\n{5}\n  11\n{1:U}\n  21\n{2:U}\n  100\nAcDbText\n  73\n{18}\n",
						crText, 
						(RA!=0) ? (rect.Left + rect.Width/4) : (rect.Left),
						m_FlowChart.DocExtents.Height - rect.Top, 
						rect.Width, 
						"0", 
						(RA!=0) ? "1" : "0",
						"" ,  
						fnText , 
						sText, 
						"" , fnText.Size, rect.Width, rect.Height, RA , "Standard", TEXT_LAYER, rect.Left + rect.Width,
						m_FlowChart.DocExtents.Height - ( rect.Top + rect.Height),
						(RA!=0) ? "1" : "2");
				
				Trace.WriteLine(String.Format("{0}:{1}", sText, rect.ToString()));
				AddEntity(String.Format("TEXT{0:X5}", TextID),sResult);
			}
			catch ( Exception ex)
			{

				Trace.WriteLine(String.Format("{0} error {1}\n","AddText",ex.Message));
				return false;

			}

			return true;
			
		}
开发者ID:ChrisMoreton,项目名称:Test3,代码行数:73,代码来源:DxfHelper.cs

示例2: Clone

        public Bitmap Clone(RectangleF rect, PixelFormat format) {

            //validate the rect
            if (rect.Width == 0 || rect.Height == 0) {
                throw new ArgumentException(SR.GetString(SR.GdiplusInvalidRectangle, rect.ToString()));
            }
            
            IntPtr dstHandle = IntPtr.Zero;

            int status = SafeNativeMethods.Gdip.GdipCloneBitmapArea(
                                                    rect.X,
                                                    rect.Y,
                                                    rect.Width,
                                                    rect.Height,
                                                    unchecked((int) format),
                                                    new HandleRef(this, nativeImage),
                                                    out dstHandle);

            if (status != SafeNativeMethods.Gdip.Ok || dstHandle == IntPtr.Zero)
                throw SafeNativeMethods.Gdip.StatusException(status);

            return Bitmap.FromGDIplus(dstHandle);
        }
开发者ID:mind0n,项目名称:hive,代码行数:23,代码来源:Bitmap.cs

示例3: LinearGradientBrush

        public LinearGradientBrush(RectangleF rect, Color color1, Color color2,
                                 float angle, bool isAngleScaleable)
        {
            IntPtr brush = IntPtr.Zero;

            //validate the rect
            if (rect.Width == 0.0 || rect.Height == 0.0) {
                throw new ArgumentException(SR.GetString(SR.GdiplusInvalidRectangle, rect.ToString()));
            }

            GPRECTF gprectf = new GPRECTF(rect);
            int status = SafeNativeMethods.Gdip.GdipCreateLineBrushFromRectWithAngle(ref gprectf,
                                                                      color1.ToArgb(),
                                                                      color2.ToArgb(),
                                                                      angle,
                                                                      isAngleScaleable,
                                                                      (int)WrapMode.Tile,
                                                                      out brush);

            if (status != SafeNativeMethods.Gdip.Ok)
                throw SafeNativeMethods.Gdip.StatusException(status);

            SetNativeBrushInternal(brush);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:24,代码来源:LinearGradientBrush.cs

示例4: Clone

 public Bitmap Clone(RectangleF rect, PixelFormat format)
 {
     if ((rect.Width == 0f) || (rect.Height == 0f))
     {
         throw new ArgumentException(System.Drawing.SR.GetString("GdiplusInvalidRectangle", new object[] { rect.ToString() }));
     }
     IntPtr zero = IntPtr.Zero;
     int status = SafeNativeMethods.Gdip.GdipCloneBitmapArea(rect.X, rect.Y, rect.Width, rect.Height, (int) format, new HandleRef(this, base.nativeImage), out zero);
     if ((status != 0) || (zero == IntPtr.Zero))
     {
         throw SafeNativeMethods.Gdip.StatusException(status);
     }
     return FromGDIplus(zero);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:Bitmap.cs


注:本文中的System.Drawing.RectangleF.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。