本文整理汇总了C#中System.Windows.Forms.Panel.Invalidate方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.Invalidate方法的具体用法?C# Panel.Invalidate怎么用?C# Panel.Invalidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Panel
的用法示例。
在下文中一共展示了Panel.Invalidate方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: randomizeArray
public static void randomizeArray(int[] array, Panel panel)
{
for (int i = 0; i < array.Length; i++)
{
array[i] = random.Next(10, 100);
}
panel.Invalidate();
}
示例2: MouseMove
public void MouseMove(ref EditorData data, Panel panel, Point gridPosition)
{
if (mouseDown&&!mPrevious.Equals(gridPosition))
{
data.SelectedEntities = data.Level.SelectEntities(mInitial, gridPosition, true);
mPrevious = gridPosition;
panel.Invalidate(panel.DisplayRectangle);
}
}
示例3: MouseMove
public void MouseMove(ref EditorData data, Panel panel, Point gridPosition)
{
if (!_mPrevious.Equals(gridPosition) && data.SelectedEntities.Count > 0 && _mouseDown)
{
//Keep an eye on this. The SelectedEntities can return an empty list
data.Level.MoveEntity(data.SelectedEntities,
new Size(Point.Subtract(gridPosition, new Size(_mPrevious))), false);
_mPrevious = gridPosition;
panel.Invalidate(panel.DisplayRectangle);
}
}
示例4: DrawWaterMark
/// <summary>
/// Draws the watermark if the text length is 0
/// </summary>
private void DrawWaterMark()
{
if (this.waterMarkContainer == null && this.TextLength <= 0)
{
waterMarkContainer = new Panel(); // Creates the new panel instance
waterMarkContainer.Paint += new PaintEventHandler(waterMarkContainer_Paint);
waterMarkContainer.Invalidate();
waterMarkContainer.Click += new EventHandler(waterMarkContainer_Click);
this.Controls.Add(waterMarkContainer); // adds the control
}
}
示例5: MouseMove
public void MouseMove(ref EditorData data, Panel panel, Point gridPosition)
{
if (data.OnDeck == null || !data.OnDeck.Paintable) return;
if (data.Level.SelectEntity(gridPosition) == null && _mPainting && !_mPrevious.Equals(gridPosition))
{
var entity = data.OnDeck.Copy();
entity.Location = gridPosition;
data.Level.AddEntity(entity, gridPosition, true);
data.SelectedEntities.Clear();
data.SelectedEntities.Add(entity);
_mPrevious = gridPosition;
panel.Invalidate(panel.DisplayRectangle);
}
}
示例6: MouseMove
public void MouseMove(ref EditorData data, Panel panel, Point gridPosition)
{
var topEntity = new ArrayList();
var entity = data.Level.SelectEntity(gridPosition);
if (entity != null && _mPainting && !_mPrevious.Equals(gridPosition))
try
{
data.SelectedEntities.Clear();
topEntity.Add(entity);
data.Level.RemoveEntity(topEntity, true);
_mPrevious = gridPosition;
panel.Invalidate(panel.DisplayRectangle);
}
catch (Exception)
{
//If the tile is empty, fail silently
}
}
示例7: PaintScroll
public static void PaintScroll(ref MouseEventArgs margs,ref Panel listpanel,ref Panel scrollpanel, ref List<Control> controllist)
{
panel2 = listpanel;
listpanel.MouseWheel -= Listpanel_MouseWheel;
newscrolled += margs.Delta;
listpanel.MouseWheel += Listpanel_MouseWheel;
if (newscrolled > oldscrolled)
{
selecteditem += 1;
beginline += 50;
endline += 50;
}
else if (newscrolled < oldscrolled)
{
selecteditem -= 1;
beginline -= 50;
endline -= 50;
}
oldscrolled = newscrolled;
scrollpanel.Invalidate();
graphic = scrollpanel.CreateGraphics();
scrollpanel.Paint += PaintScrollBar;
}
示例8: DrawShip
//We draw the ships
public void DrawShip(int y, int x, int w, int h, int size, Panel panelBattle)
{
RemoveShip();
CreateShip(x, y, 1, size - 1, _Player);
for (int i = 0; i < _Player.Count(); ++i)
{
for (int j = 0; j < _Player[i].Count(); ++j)
{
if (Rendering(x, y, i, j, size - 1))
{
panelBattle.Invalidate(new Rectangle(i * w, j * h, w, h));
}
}
}
}
示例9: panel2_MouseDown
private void panel2_MouseDown(object sender, MouseEventArgs e)
{
Panel painel = (Panel)sender;
if(e.Button == MouseButtons.Left)
{
obj = (Panel) sender;
Dragging = true;
mousex = -e.X;
mousey = -e.Y;
int clipleft = panel1.PointToClient(MousePosition).X - obj.Location.X;
int cliptop = panel1.PointToClient(MousePosition).Y - obj.Location.Y;
int clipwidth = panel1.ClientSize.Width - (obj.Width - clipleft);
int clipheight = panel1.ClientSize.Height - (obj.Height - cliptop);
Cursor.Clip = panel1.RectangleToScreen(new Rectangle(clipleft, cliptop, clipwidth, clipheight));
obj.Invalidate();
}
}
示例10: InvalidateAndUpdate
private void InvalidateAndUpdate(Panel panel)
{
panel.Invalidate(true);
panel.Update();
}
示例11: mouseEvent
void mouseEvent(Panel panel, MouseEventArgs e, FileCharset charset)
{
int c = e.X / (FileCharset.CharWidth + 2);
int f = e.Y / (FileCharset.CharHeight + 2);
byte id = (byte)((f * 16) + c);
if (e.Button == MouseButtons.Left)
{
character = charset.getChar(id);
panel3.Invalidate();
}
else if (e.Button == MouseButtons.Right)
{
if (charset!=null && character != null)
charset.setChar(id, character);
panel.Invalidate();
}
}
示例12: CreateView
public override object CreateView(Panel hostPanel)
{
NLView nlView = new NLView();
if (_image != null)
nlView.Image = _image.ToBitmap();
else
nlView.Image = null;
nlView.DetectionDetails = _detectionDetails;
nlView.Dock = DockStyle.Fill;
hostPanel.Controls.Add(nlView);
hostPanel.PerformLayout();
nlView.AutoScroll = true;
hostPanel.Invalidate();
return nlView;
}
示例13: SelectionSort
public static void SelectionSort(int[] array, Panel panel)
{
// cheating..... should implement algorithm...
Array.Sort(array);
panel.Invalidate();
}
示例14: WocketsScalablePlotter
public WocketsScalablePlotter(System.Windows.Forms.Panel aPanel)
{
this.numSensors = CurrentWockets._Controller._Sensors.Count;
if (numSensors > 3)
skippedPoints = 3;
else if (numSensors > 1)
skippedPoints = 2;
this.aPanel = aPanel;
this.plotAreaSize = new Size(this.aPanel.Width, ((int)(this.aPanel.Height)));
graphSize = (int)Math.Floor((plotAreaSize.Height / ((double)numSensors)));
scaleFactors = new double[numSensors];
currentColumns = new int[numSensors];
firstColumn = new int[numSensors];
lastColumn = new int[numSensors];
decoderTails = new int[numSensors];
lastUnixTimestamps = new double[numSensors];
this.pointsToPlot = new int[numSensors];
this.mode = PlottingMode.Normal;
for (int i = 0; (i < numSensors); i++)
{
this.currentColumns[i] = this.plotAreaSize.Width - 1;
this.firstColumn[i] = 999999;
this.lastColumn[i] = this.plotAreaSize.Width - 1;
this.decoderTails[i] = CurrentWockets._Controller._Sensors[i]._Decoder._Head;
this.lastUnixTimestamps[i] = 0;
this.pointsToPlot[i] = 0;
double range = 1024;//((Accelerometer)this.wocketsController._Sensors[i])._Max - ((Accelerometer)this.wocketsController._Sensors[i])._Min;
scaleFactors[i] = graphSize / range;
}
int dy = (int)Math.Floor(plotAreaSize.Height / ((double)numSensors));
int offset = dy;
axisOffset = new int[numSensors];
for (int i = 0; i < axisOffset.Length; i++)
{
axisOffset[i] = offset;
offset += dy;
}
previousTimes = new double[numSensors];
previousVals = new int[numSensors][];
for (int i = 0; (i < numSensors); i++)
{
previousVals[i] = new int[3];
for (int j = 0; (j < 3); j++)
previousVals[i][j] = 0;
}
p = new System.Drawing.Pen[SIGNALS_PER_AXIS];
p[0] = new Pen(System.Drawing.Color.Orange);
p[1] = new Pen(System.Drawing.Color.Red);
p[2] = new Pen(System.Drawing.Color.Blue);
requiresFullRedraw = true;
aPanel.Invalidate();
}