• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DrawState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DrawState的典型用法代码示例。如果您正苦于以下问题:C# DrawState类的具体用法?C# DrawState怎么用?C# DrawState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DrawState类属于命名空间,在下文中一共展示了DrawState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DrawBackground

 protected void DrawBackground(Graphics g, DrawState state)
 {
     Rectangle rc = ClientRectangle;
     // Draw background
     if (state == DrawState.Normal || state == DrawState.Disable)
     {
         g.FillRectangle(new SolidBrush(SystemColors.Control), rc);
         using (SolidBrush rcBrush = state == DrawState.Disable ?
             new SolidBrush(SystemColors.ControlDark) :
             new SolidBrush(SystemColors.ControlDarkDark))
         {
             // Draw border rectangle
             g.DrawRectangle(new Pen(rcBrush), rc.Left, rc.Top, rc.Width - 1, rc.Height - 1);
         }
     }
     else if ( state == DrawState.Hot || state == DrawState.Pressed  )
     {
         // Erase whaterver that was there before
         if ( state == DrawState.Hot )
             g.FillRectangle(new SolidBrush(ColorUtil.VSNetSelectionColor), rc);
         else
             g.FillRectangle(new SolidBrush(ColorUtil.VSNetPressedColor), rc);
         // Draw border rectangle
         g.DrawRectangle(SystemPens.Highlight, rc.Left, rc.Top, rc.Width-1, rc.Height-1);
     }
 }
开发者ID:sillsdev,项目名称:CarlaLegacy,代码行数:26,代码来源:ButtonEx.cs


示例2: OnLostFocus

 protected override void OnLostFocus(EventArgs e)
 {
     // Set state to Normal
       base.OnLostFocus(e);
       drawState = DrawState.Normal;
       Invalidate();
 }
开发者ID:tiankongldp,项目名称:MyTestApplication,代码行数:7,代码来源:TextBoxEx.cs


示例3: DrawBackground

        protected void DrawBackground( Graphics g, DrawState state )
        {
            Rectangle rc = ClientRectangle;

              // Draw background
              if( state == DrawState.Normal || state == DrawState.Disable )
              {
            g.FillRectangle( SystemBrushes.Control, rc );

            Pen p = ( state == DrawState.Disable ) ? SystemPens.ControlDark : SystemPens.ControlDarkDark;

            // Draw border rectangle
            g.DrawRectangle( p, rc.Left, rc.Top, rc.Width-1, rc.Height-1);

              }
              else if( state == DrawState.Hot || state == DrawState.Pressed  )
              {
            // Erase whaterver that was there before
            if ( state == DrawState.Hot )
              g.FillRectangle( ColorUtil.VSNetSelectionBrush, rc );
            else
              g.FillRectangle( ColorUtil.VSNetPressedBrush, rc );

            // Draw border rectangle
            g.DrawRectangle( SystemPens.Highlight, rc.Left, rc.Top, rc.Width-1, rc.Height-1 );
              }
        }
开发者ID:tiankongldp,项目名称:MyTestApplication,代码行数:27,代码来源:ButtonEx.cs


示例4: Start

 void Start()
 {
     _drawStates = new DrawState[_pinchDetectors.Length];
       for (int i = 0; i < _pinchDetectors.Length; i++) {
     _drawStates[i] = new DrawState(this);
       }
 }
开发者ID:emomper23,项目名称:PsychVR,代码行数:7,代码来源:PinchDraw.cs


示例5: DrawImageEventArgs

 //=====================================================================
 /// <summary>Constructor</summary>
 /// <param name="graphics">The graphics context</param>
 /// <param name="state">The drawing state of the item</param>
 /// <param name="offset">The image offset if scrolled</param>
 /// <param name="drawFocus">A flag indicating whether or not to draw the focus rectangle on return</param>
 public DrawImageEventArgs(Graphics graphics, DrawState state, Point offset, bool drawFocus)
 {
     this.Graphics = graphics;
     this.DrawState = state;
     this.ImageOffset = offset;
     this.DrawFocus = drawFocus;
 }
开发者ID:exaphaser,项目名称:ImageMaps,代码行数:13,代码来源:DrawImageEventArgs.cs


示例6: ChangeDrawState

        public void ChangeDrawState(DrawState drawState, int id)
        {
            //選択できる範囲外だったら何もせずに終了
            if (!CanChangeDrawState(drawState, id)) return;

            switch (drawState)
            {
                case DrawState.MapChip:
                    MapChipPalletViewModel.DrawMapState.Set(id);
                    ObjectChipPalletViewModel.SelectCancel();
                    _current = MapChipPalletViewModel;
                    break;

                case DrawState.ObjChip:
                    ObjectChipPalletViewModel.DrawObjectState.Set(id);
                    MapChipPalletViewModel.SelectCancel();
                    _current = ObjectChipPalletViewModel;
                    break;

                case DrawState.Empty:
                    //何もしない
                    break;
                default:
                    throw new ArgumentOutOfRangeException("drawState");
            }
        }
开发者ID:lltcggie,项目名称:StageMapEditor,代码行数:26,代码来源:PalletViewModelManager.cs


示例7: OnMouseEnter

 protected override void OnMouseEnter(EventArgs e)
 {
     // Set state to hot
       base.OnMouseEnter(e);
       drawState = DrawState.Hot;
       Invalidate();
 }
开发者ID:tiankongldp,项目名称:MyTestApplication,代码行数:7,代码来源:RadioButtonEx.cs


示例8: BindShader

		protected override IShader BindShader(DrawState state, bool maskOnly)
		{
			Xen.Ex.Graphics2D.Statistics.DrawGraphLine shader = state.GetShader<Xen.Ex.Graphics2D.Statistics.DrawGraphLine>();

			if (dirty)
			{
				float x = widthScale;
				for (int i = 0; i < graphData.Length; i++)
				{
					int index = (i + this.index) % graphData.Length;
					float good = 0;

					if (goodValue != 0)
					{
						good = values[index];
						good = (good - Math.Abs(goodValue)) / goodValue;
					}
					graphData[i] = new Vector4(x, values[index] * maxValueInv, 0, good);
					x += widthScale;
				}
				dirty = false;
			}

			shader.GraphLine = this.graphData;

			return shader;
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:27,代码来源:Stats.cs


示例9: OnGotFocus

 protected override void OnGotFocus(EventArgs e)
 {
     // Set state to Hot
       base.OnGotFocus(e);
       drawState = DrawState.Hot;
       Invalidate();
 }
开发者ID:tiankongldp,项目名称:MyTestApplication,代码行数:7,代码来源:TextBoxEx.cs


示例10: Begin

		/// <summary>
		/// Begin the modifier (This method is called by the DrawTarget)
		/// </summary>
		/// <param name="state"></param>
		public void Begin(DrawState state)
		{
			enabledBuffer = enabled;
			this.cameras = state.Camera;

			if (enabledBuffer)
				state.Cullers.PushPostCuller(this);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:12,代码来源:CullTestVisualizer.cs


示例11: MatrixCalc

 public MatrixCalc(MatrixOp op, MatrixSource provider, MatrixSource source, DrawState state)
 {
     #if DEBUG
     this.state = state;
     #endif
     this.op = op;
     this.provider = provider;
     this.source = source;
 }
开发者ID:TormentedEmu,项目名称:OpenUO,代码行数:9,代码来源:MatrixCalc.cs


示例12: DrawButtonState

        protected void DrawButtonState(Graphics g, DrawState state)
        {
            DrawBackground(g, state);
            Rectangle rc = ClientRectangle;

            bool hasText = false;
            bool hasImage = Image != null;
            Size textSize = new Size(0,0);
            if ( Text != string.Empty && Text != "" )
            {
                hasText = true;
                textSize = TextUtil.GetTextSize(g, Text, Font);
            }

            int imageWidth = 0;
            int imageHeight = 0;
            if ( hasImage )
            {
                SizeF sizeF = Image.PhysicalDimension;
                imageWidth = (int)sizeF.Width;
                imageHeight = (int)sizeF.Height;
                // We are assuming that the button image is smaller than
                // the button itself
                if ( imageWidth > rc.Width || imageHeight > rc.Height)
                {
                    Debug.WriteLine("Image dimensions need to be smaller that button's dimension...");
                    return;
                }
            }

            int x, y;
            if ( hasText && !hasImage )
            {
                // Text only drawing
                x = (Width - textSize.Width)/2;
                y = (Height - textSize.Height)/2;
                DrawText(g, Text, state, x, y);
            }
            else if ( hasImage && !hasText )
            {
                // Image only drawing
                x = (Width - imageWidth)/2;
                y = (Height - imageHeight)/2;
                DrawImage(g, state, Image, x, y);
            }
            else
            {
                // Text and Image drawing
                x = (Width - textSize.Width - imageWidth -2)/2;
                y = (Height - imageHeight)/2;
                DrawImage(g, state, Image, x, y);
                x += imageWidth + 2;
                y = (Height - textSize.Height)/2;
                DrawText(g, Text, state, x, y);
            }
        }
开发者ID:sillsdev,项目名称:CarlaLegacy,代码行数:56,代码来源:ButtonEx.cs


示例13: OnMouseLeave

 protected override void OnMouseLeave(EventArgs e)
 {
   // Set state to Normal
   base.OnMouseLeave(e);
   if ( !ContainsFocus )
   {
     drawState = DrawState.Normal;
     Invalidate();
   }
 }
开发者ID:ewosp,项目名称:sycorax,代码行数:10,代码来源:CheckBoxEx.cs


示例14: DrawButtonState

        protected void DrawButtonState( Graphics g, DrawState state )
        {
            DrawBackground( g, state );
              Rectangle rc = ClientRectangle;
              Rectangle rcText = Rectangle.Inflate( ClientRectangle, -1, -1 );

              // draw Image
              if( Image != null )
              {
            SizeF sizeF   = Image.PhysicalDimension;
            int imgWidth  = (int)sizeF.Width;
            int imgHeight = (int)sizeF.Height;

            StringAlignment imgVAlign = GetVerticalAlign( ImageAlign );
            StringAlignment imgHAlign = GetHorizontalAlign( ImageAlign );

            int minWid = Width - 2, minHg = Height - 2;

            minWid = Math.Min( minWid, imgWidth );
            minHg = Math.Min( minHg, imgHeight );

            int xPos = Math.Min( minHg, minWid ) + 2;

            Bitmap bmp = new Bitmap( Image, new Size( minWid, minHg ) );

            int y = 1;

            if( imgVAlign == StringAlignment.Center )
            {
              y = ( Height - bmp.Height ) / 2;
            }
            else if( imgVAlign == StringAlignment.Far )
            {
              y = ( Height - bmp.Height - 1 );
            }

            switch( imgHAlign )
            {
              case StringAlignment.Near:
            rcText.X = xPos;  rcText.Width -= xPos;
            DrawImage( g, state, bmp, 2+(xPos-minWid)/2, y );
            break;

              case StringAlignment.Far:
            rcText.Width = rcText.Right - xPos;
            DrawImage( g, state, bmp, rcText.Right + (xPos-minWid)/2 - 2, y );
            break;
            }

            bmp.Dispose();
              }

              // draw Text
              DrawText( g, Text, state, rcText );
        }
开发者ID:tiankongldp,项目名称:MyTestApplication,代码行数:55,代码来源:ButtonEx.cs


示例15: Draw

        public override void Draw(IOutputCommand output, DrawState state, object param)
		{
            double I, J;
            if (!TryGetVariable('I', out I))
            {
                I = 0;
            }
            if (!TryGetVariable('J', out J))
            {
                J = 0;
            }

            output.DrawArc(this,param, Convert(Movetype, state), CalculatedStartPosition, CalculatedEndPosition,new Framework.Tools.Drawing.Point3D() { X=I, Y=J},true);
       }
开发者ID:aiten,项目名称:CNCLib,代码行数:14,代码来源:G02Command.cs


示例16: DrawStateProperties

			internal DrawStateProperties(DrawState state)
			{
				this.state = state;
				state.Application.Content.Add(this);
			}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:5,代码来源:DrawStateRender.cs


示例17: DrawCallback

		//call made by a particle drawer
		internal void DrawCallback(DrawState state, IParticleSystemDrawer particleDrawer)
		{
			if (systemLogic == null)
				throw new InvalidOperationException("Attempting to draw a ParticleSystem with unassigned ParticleSystemData Content");
			
			if (disposed)
				return;

			this.drawProc.MarkAsDrawn();

			//loop all the particle stores, and draw them all
			foreach (ParticleStore store in this.particleStore)
				store.ParticleProcessor.DrawCallback(state, particleDrawer, store.Count);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:15,代码来源:ParticleSystem.cs


示例18: Warm

		/// <summary>
		/// Warms the particle system (preloads any resources used)
		/// </summary>
		/// <param name="state"></param>
		public void Warm(DrawState state)
		{
			if (this.systemData == null)
				throw new InvalidOperationException("ParticleSystemData == null");
			foreach (ParticleStore store in this.particleStore)
				store.ParticleProcessor.Warm(state.Application);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:11,代码来源:ParticleSystem.cs


示例19: End

		/// <summary></summary>
		/// <param name="state"></param>
		protected internal override void End(DrawState state)
		{
			if (targets == null)
				throw new ObjectDisposedException("this");
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:7,代码来源:DrawTarget.cs


示例20: Begin

		/// <summary></summary>
		/// <param name="state"></param>
		protected internal override void Begin(DrawState state)
		{
			if (targets == null)
				throw new ObjectDisposedException("this");

			for (int i = 0; i < targets.Length; i++)
			{
				targets[i].Warm(state);
				if (targets[i].IsDisposed)
					throw new ObjectDisposedException("RenderTexture");
			}

#if XBOX360
			state.nonScreenRenderComplete = true;
#endif

			GraphicsDevice device = state.graphics;

			state.shaderSystem.ResetTextures();

			if (binding == null)
			{
				this.binding = new RenderTargetBinding[targets.Length];
				for (int i = 0; i < targets.Length; i++)
					binding[i] = new RenderTargetBinding(targets[i].GetRenderTarget2D());
			}

			device.SetRenderTargets(binding);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:31,代码来源:DrawTarget.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Drawable类代码示例发布时间:2022-05-24
下一篇:
C# DrawMode类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap