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


C# System.PaintEventHandler类代码示例

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


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

示例1: NiceClosePanel

        /// <summary>Initialises a new <see cref="NiceClosePanel"/> instance.</summary>
        public NiceClosePanel()
            : base()
        {
            _closeButton = new System.Windows.Forms.Button();
            _closeButton.Name = "_closeButton";
            _closeButton.Size = new System.Drawing.Size(8, 8);
            _closeButton.Text = "X";
            _closeButton.Tag = "notranslate";
            _closeButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            // This is a small 8×8 PNG that contains a black X on a transparent background
            _closeButton.Image = new Bitmap(new MemoryStream(new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 8, 0, 0, 0, 8, 8, 6, 0, 0, 0, 196, 15, 190, 139, 0, 0, 0, 89, 73, 68, 65, 84, 40, 83, 99, 96, 128, 0, 126, 40, 141, 76, 113, 194, 56, 32, 198, 109, 32, 246, 64, 146, 53, 0, 178, 239, 1, 177, 16, 76, 204, 24, 200, 120, 2, 85, 4, 146, 124, 142, 166, 1, 172, 14, 164, 232, 37, 16, 191, 195, 38, 9, 82, 0, 210, 249, 6, 138, 145, 173, 3, 235, 70, 54, 22, 217, 58, 176, 36, 27, 16, 95, 69, 51, 22, 164, 8, 197, 145, 112, 47, 33, 249, 4, 44, 6, 0, 149, 131, 14, 219, 10, 117, 71, 99, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }));
            _closeButton.Margin = new System.Windows.Forms.Padding(0);
            _closeButton.Padding = new System.Windows.Forms.Padding(0, 0, 2, 2);
            _closeButton.TabIndex = 0;
            _closeButton.TabStop = false;

            Controls.Add(_closeButton);
            Resize += new EventHandler(resize);
            Paint += new PaintEventHandler(paint);
            _closeButton.Click += new EventHandler(fireCloseClicked);

            // This is a workaround which appears to be necessary in Mono. Otherwise the button does not appear until the first time the level list is resized.
            Timer t = new Timer { Interval = 100 };
            t.Tick += (s, e) => { resize(s, e); t.Enabled = false; };
            t.Enabled = true;
        }
开发者ID:RT-Projects,项目名称:RT.Util,代码行数:27,代码来源:NiceClosePanel.cs

示例2: CWTForm

        //*********************************************************
        //   constructor class for main program.  Event handlers
        //   are actually linked to menu items here.
        //   Also: paint and print functions display and print
        //   results.
        //*********************************************************
        public CWTForm()
        {
            Text = "CWT";
            FormBorderStyle = FormBorderStyle.FixedDialog;
            Size = new System.Drawing.Size(600, 600);

            image_width = 512;
            image_height = 256;
            sigma = 4.0;
            omega = 1.0;
            upper_freq = 5000;//128.0;
            lower_freq = 20;//4.0;
            //signal_data = new Double[16384];
            signal_data = new Double[55120];
            image_data = new Double[image_width*image_height]; //131072
            bmp = new Bitmap(image_width,image_height,System.Drawing.Imaging.PixelFormat.Format32bppPArgb);

            Setup_Menu();

            Paint += new PaintEventHandler(Form_Paint);
            printMenuItem.Click += new EventHandler(MenuItem_Clicked);
            fileopenMenuItem.Click += new EventHandler(MenuItem_Clicked);
            exportEPSMenuItem.Click += new EventHandler(MenuItem_Clicked);
            exitMenuItem.Click += new EventHandler(MenuItem_Clicked);
            spectrogramMenuItem.Click += new EventHandler(MenuItem_Clicked);
            waveletMenuItem.Click += new EventHandler(MenuItem_Clicked);
            helpMenu.Click += new EventHandler(MenuItem_Clicked);
        }
开发者ID:remy22,项目名称:AudioVSTToolbox,代码行数:34,代码来源:CWTForm.cs

示例3: VoiceToolstripButton

        public VoiceToolstripButton(VoiceService voices)
        {
            Voices = voices;

            ToolTipText = "Voice Chat";

            Paint += new PaintEventHandler(VoiceToolstripButton_Paint);

            ButtonClick += new EventHandler(VoiceToolstripButton_ButtonClick);
            MouseDown += new MouseEventHandler(VoiceToolstripButton_MouseDown);
            MouseUp += new MouseEventHandler(VoiceToolstripButton_MouseUp);
            OffButton = new ToolStripMenuItem("Off", Res.VoiceRes.VoiceOff, OffButton_Clicked);
            VoiceActivatedButton = new ToolStripMenuItem("Voice Activated", Res.VoiceRes.VoiceVAD, VoiceActivatedButton_Clicked);
            PushtoTalkButton = new ToolStripMenuItem("Push to Talk", Res.VoiceRes.VoicePTT, PushtoTalkButton_Clicked);
            MuteButton = new ToolStripMenuItem("Mute", Res.VoiceRes.VoiceMute, MuteButton_Clicked);
            SettingsButton = new ToolStripMenuItem("Settings", Res.VoiceRes.VoiceSettings, SettingsButton_Clicked);

            DropDownItems.Add(OffButton);
            DropDownItems.Add(VoiceActivatedButton);
            DropDownItems.Add(PushtoTalkButton);
            DropDownItems.Add(MuteButton);
            DropDownItems.Add(SettingsButton);

            WindowID = Voices.Core.RndGen.Next();

            Voices.RegisterWindow(WindowID, new VolumeUpdateHandler(VoiceService_VolumeUpdate));

            OffButton.PerformClick();
        }
开发者ID:RoelofSol,项目名称:DeOps,代码行数:29,代码来源:VoiceToolstripButton.cs

示例4: FractalView

        public FractalView()
        {
            fractalImageCacheInvalidated = true;

            MouseClick += new MouseEventHandler(GAPictureBox_Click);
            Paint += new PaintEventHandler(GAPanel_Paint);
        }
开发者ID:rrhvella,项目名称:thesis-mandelbrot-evolver,代码行数:7,代码来源:FractalView.cs

示例5: DropDockingIndicatorsSquare

        /// <summary>
        /// Initialize a new instance of the DropDockingIndicatorsSquare class.
        /// </summary>
        /// <param name="paletteDragDrop">Drawing palette.</param>
        /// <param name="renderer">Drawing renderer.</param>
        /// <param name="showLeft">Show left hot area.</param>
        /// <param name="showRight">Show right hot area.</param>
        /// <param name="showTop">Show top hot area.</param>
        /// <param name="showBottom">Show bottom hot area.</param>
        /// <param name="showMiddle">Show middle hot area.</param>
        public DropDockingIndicatorsSquare(IPaletteDragDrop paletteDragDrop, 
                                           IRenderer renderer,
							               bool showLeft, bool showRight,
							               bool showTop, bool showBottom,
                                           bool showMiddle)
        {
            _paletteDragDrop = paletteDragDrop;
            _renderer = renderer;

            // Initialize the drag data that indicators which docking indicators are needed
            _dragData = new RenderDragDockingData(showLeft, showRight, showTop, showBottom, showMiddle);

            // Ask the renderer to measure the sizing of the indicators that are displayed
            _renderer.RenderGlyph.MeasureDragDropDockingGlyph(_dragData, _paletteDragDrop, PaletteDragFeedback.Square);

            // Setup window so that it is transparent to the Silver color and does not have any borders etc...
            BackColor = Color.Silver;
            ClientSize = _dragData.DockWindowSize;
            ControlBox = false;
            FormBorderStyle = FormBorderStyle.None;
            Location = new Point(100, 200);
            MaximizeBox = false;
            MinimizeBox = false;
            MinimumSize = Size.Empty;
            Name = "DropIndicators";
            ShowInTaskbar = false;
            SizeGripStyle = SizeGripStyle.Hide;
            StartPosition = FormStartPosition.Manual;
            Text = "DropIndicators";
            TransparencyKey = System.Drawing.Color.Silver;
            Paint += new PaintEventHandler(DropIndicators_Paint);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:42,代码来源:DropDockingIndicatorsSquare.cs

示例6: ColorButton

 public ColorButton()
 {
     MouseEnter += new EventHandler(OnMouseEnter);
     MouseLeave += new EventHandler(OnMouseLeave);
     MouseUp += new MouseEventHandler(OnMouseUp);
     Paint += new PaintEventHandler(ButtonPaint);
 }
开发者ID:novalis78,项目名称:Pali-Text-Reader,代码行数:7,代码来源:ColorButton.cs

示例7: RayCastForm

        public RayCastForm()
        {
            InitializeComponent();
            UpdateWorker.WorkerReportsProgress = true;
            UpdateWorker.WorkerSupportsCancellation = true;

            RenderGraphics=this.CreateGraphics();

            for (int i = 0; i <=10; i++)
            {
                rSolidBrush = new SolidBrush(Color.FromArgb(i*25, 0, 0));
                solidBrushes.Add(rSolidBrush);
                pens.Add(new Pen(rSolidBrush));
            }

            int ix = 0;
            //RPen = new Pen(GetBrushFromList(solidBrushes,10));
            RPen = GetPenFromList(pens, 10);

            MyRayCast=new CRayCast(this.Width,this.Height);
            MyRayCast.InitRayCast();
            GeneratePens();
            mPen = new Pen(new SolidBrush(Color.White));
            backpen = new Pen(new SolidBrush(Color.Red));

            backpen.DashStyle=DashStyle.Dash;
            UpdateWorker.RunWorkerAsync();

            Paint +=new PaintEventHandler(RayCastForm_Paint);

            //RenderGraphics.Dispose();
        }
开发者ID:DmitryFilippow,项目名称:C_Sharp,代码行数:32,代码来源:Form1.cs

示例8: MyForm

        /// <summary> The Constructor for our application</summary>
        MyForm()
        {
            //Initial settings for our Form window
            Size = new Size(400, 300);
            Text = " Collision on Either Side";
            BackColor = Color.Black;
            CenterToScreen();

            /// <remarks>Turn on double-buffering to eliminate flickering </remarks>
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);

            /// <remarks>Create Paint Event Handler:
            /// fired every time Windows says it's time to repaint the Form. </remarks>
            Paint += new PaintEventHandler(DrawStuff);

            /// <remarks>Creates a new mouse movement event handler </remarks>
            MouseMove += new MouseEventHandler(MouseMoveUpdate);

            ZoneLeft = ZoneX - (ZoneWidth / 2); // The left side is half the Width to the left of Center
            ZoneRight = ZoneX + (ZoneWidth / 2); // Half the Width to the right
            ZoneTop = ZoneY - (ZoneHeight / 2); // obviously this must turn seaweed into fertilizer
            ZoneBottom = ZoneY + (ZoneHeight / 2);
        }
开发者ID:JeremiahZhang,项目名称:AKA,代码行数:26,代码来源:Program.cs

示例9: Outline

        public Outline(Point center)
        {
            var sideLength = 50;
            center.Offset(-sideLength / 2, -sideLength/2);
            nodes.Add(PanAndZoom.fromLocalToGlobal(center));

            center.Offset(0, sideLength);
            nodes.Add(PanAndZoom.fromLocalToGlobal(center));

            center.Offset(sideLength, 0);
            nodes.Add(PanAndZoom.fromLocalToGlobal(center));

            center.Offset(0, -sideLength);
            nodes.Add(PanAndZoom.fromLocalToGlobal(center));

            //parent.Controls.Add(this);
            //BringToFront();

            foreach(var n in nodes){
                var marker = new VertexMarker();
                marker.setPosition(n);
                marker.MouseClick += new MouseEventHandler(deleteMarker);
                markers.Add(marker);

                marker.BringToFront();

                var c = new CreaterMarker();
                c.MouseClick += new MouseEventHandler(createMarker);
                //parent.Controls.Add(c);
                creaters.Add(c);
            }
            paintEvent = new PaintEventHandler(paint);
        }
开发者ID:Scrivener07,项目名称:moddingSuite,代码行数:33,代码来源:Outline.cs

示例10: RichTextBoxBordered

        public RichTextBoxBordered()
        {
            InitializeComponent();

            Paint += new PaintEventHandler(UserControl1_Paint);
            Resize += new EventHandler(UserControl1_Resize);
        }
开发者ID:blahblahblahblah831,项目名称:brawltools2,代码行数:7,代码来源:RichTextBoxBordered.cs

示例11: Game

        public Game()
        {
            InitializeComponent();

            SetStyle(
                ControlStyles.UserPaint |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.DoubleBuffer |
                ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.AllPaintingInWmPaint,
                true
            );

            Image roadImage = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Racemap.bmp"));
            BackgroundImage = Image.FromFile(Path.Combine(Environment.CurrentDirectory, "Racemapv3.bmp"));
            roadBitmap = new Bitmap(roadImage);
            //BackgroundImage = roadImage; //DEBUG

            player = new System.Media.SoundPlayer();
            player.SoundLocation = Path.Combine(Environment.CurrentDirectory, "music.wav");
            player.LoadAsync();

            nyanPlayer = new System.Media.SoundPlayer();
            nyanPlayer.SoundLocation = Path.Combine(Environment.CurrentDirectory, "nyan.wav");
            nyanPlayer.LoadAsync();

            Paint += new PaintEventHandler(PaintHandler);

            Init();
        }
开发者ID:Sander-Kastelein,项目名称:NHL-Racegame,代码行数:30,代码来源:Game.cs

示例12: BasicForm

		public BasicForm()
		{
			Version v = System.Environment.Version;

			if (v.Major < 2)
			{
				this.SetStyle(ControlStyles.DoubleBuffer, true);
			}
			else
			{
				this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
			}

			this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
			this.SetStyle(ControlStyles.UserPaint, true);
			this.SetStyle(ControlStyles.ResizeRedraw, true);
			this.DoubleBuffered = true;
			InitializeComponent();
			
			Text = "";
			Resizable = true;
			ControlBox = false;
			StartPosition = FormStartPosition.CenterScreen;
			FormBorderStyle = FormBorderStyle.None;
			Paint += new PaintEventHandler(BasicForm_Paint);
			ParamUpdate();
		}
开发者ID:mind0n,项目名称:hive,代码行数:27,代码来源:BasicForm.cs

示例13: LineSeparator

 public LineSeparator()
 {
     //InitializeComponent();
     Paint += new PaintEventHandler(LineSeparator_Paint);
     MaximumSize = new Size(2000, 2);
     MinimumSize = new Size(0, 2);
     Width = 350;
 }
开发者ID:xianyinchen,项目名称:SAI-Editor,代码行数:8,代码来源:LineSeparator.cs

示例14: FormSplashScreen

        public FormSplashScreen() {
            InitializeComponent();
            GlassArea = ClientRectangle;
            LogMessage = "Loading The server for setting up of the server..";
            _devList = GenerateDevList();

            Paint += new PaintEventHandler(FormSplashScreen_Paint);
        }
开发者ID:nullpic,项目名称:MCForge-Vanilla,代码行数:8,代码来源:FormSplashScreen.cs

示例15: MTScratchpadRTStylusForm

        // MTScratchpadRTStylusForm constructor
        public MTScratchpadRTStylusForm()
        {
            InitializeComponent();

            // Setup event handlers
            Load += new System.EventHandler(this.OnLoadHandler);
            Paint += new PaintEventHandler(this.OnPaintHandler);
        }
开发者ID:dgrapp1,项目名称:WindowsSDK7-Samples,代码行数:9,代码来源:MTScratchpadRTStylus.cs


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