本文整理汇总了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;
}
示例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);
}
示例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();
}
示例4: FractalView
public FractalView()
{
fractalImageCacheInvalidated = true;
MouseClick += new MouseEventHandler(GAPictureBox_Click);
Paint += new PaintEventHandler(GAPanel_Paint);
}
示例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);
}
示例6: ColorButton
public ColorButton()
{
MouseEnter += new EventHandler(OnMouseEnter);
MouseLeave += new EventHandler(OnMouseLeave);
MouseUp += new MouseEventHandler(OnMouseUp);
Paint += new PaintEventHandler(ButtonPaint);
}
示例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();
}
示例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);
}
示例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);
}
示例10: RichTextBoxBordered
public RichTextBoxBordered()
{
InitializeComponent();
Paint += new PaintEventHandler(UserControl1_Paint);
Resize += new EventHandler(UserControl1_Resize);
}
示例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();
}
示例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();
}
示例13: LineSeparator
public LineSeparator()
{
//InitializeComponent();
Paint += new PaintEventHandler(LineSeparator_Paint);
MaximumSize = new Size(2000, 2);
MinimumSize = new Size(0, 2);
Width = 350;
}
示例14: FormSplashScreen
public FormSplashScreen() {
InitializeComponent();
GlassArea = ClientRectangle;
LogMessage = "Loading The server for setting up of the server..";
_devList = GenerateDevList();
Paint += new PaintEventHandler(FormSplashScreen_Paint);
}
示例15: MTScratchpadRTStylusForm
// MTScratchpadRTStylusForm constructor
public MTScratchpadRTStylusForm()
{
InitializeComponent();
// Setup event handlers
Load += new System.EventHandler(this.OnLoadHandler);
Paint += new PaintEventHandler(this.OnPaintHandler);
}