本文整理汇总了C#中System.Windows.Forms.PictureBox.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# PictureBox.BringToFront方法的具体用法?C# PictureBox.BringToFront怎么用?C# PictureBox.BringToFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.PictureBox
的用法示例。
在下文中一共展示了PictureBox.BringToFront方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize_Form
public void Initialize_Form()
{
#region main controls
transBox = new PictureBox();
transBox.Size = new Size(1000, 1000);
transBox.Location = new Point(-0, -150);
transBox.BackColor = Color.FromArgb(32,32,32);
transBox.BringToFront();
transBox.Visible = true;
this.Controls.Add(transBox);
transBox.BringToFront();
this.Location = new Point(500, 200);
InitializeComponent();
#endregion
}
示例2: Joueur
private int totalPoint; // le score du joueur
#endregion Fields
#region Constructors
// constructeur, on recoit le panel, le point de départ dans le panel et si le joueur est le premier ou le deuxieme
public Joueur(Panel panel, Point loc, bool j1)
{
pBJoueur = new PictureBox(); // on instencie le pB du joueur
pBJoueur.Location = loc; // on place le joueur a la bonne position dans le panel
pBJoueur.BackColor = Color.Transparent; // Astuce pour avoir un fond transparent avec un bitmap. La couleur de fond est transparente
Bitmap vaisseau;
if (j1) // Si c'est le joueur 1 alors il sera blanc. On choisi un pixel ( dans un des coins) dont la couleur correspondra au transparent
{
joueur1 = true; // variable pour les animations (pas avoir de changement de couleurs lors du changement d'image)
vaisseau = new Bitmap(@".\vaisseau.bmp");
vaisseau.MakeTransparent((vaisseau.GetPixel(0, vaisseau.Size.Height - 1)));
} // si c'est le joueur 2
else
{
joueur1 = false;
vaisseau = new Bitmap(@".\vaisseau2.bmp");
vaisseau.MakeTransparent((vaisseau.GetPixel(0, vaisseau.Size.Height - 1)));
}
pBJoueur.Size = new Size(50, 50); // on donne la taille au pB
pBJoueur.Image = vaisseau; // On donne au pB l'image
pBJoueur.BringToFront(); // On met le pB au premier plan pour éviter des recouvrements
this.panelFond = panel; // On met le panel recu dans une des variables pour éviter de devoir faire des envois intempestifs
panelFond.Controls.Add(pBJoueur); // on ajoute le joueur au controle du panel (pour qu'on ne voie pas le gros carré noir)
pBJoueur.Refresh(); // Pour etre certain que l'image est bien présente dans le pB
totalPoint = 0; // on mets son score a 0
combo = 1000; // On rempli sa jauge de super tir
}
示例3: addPB
private void addPB(PictureBox i_picturebox, int i_top, int i_left)
{
i_picturebox.Top = i_top;
i_picturebox.Left = i_left;
i_picturebox.BringToFront();
m_txtBox.FindForm().Controls.Add(i_picturebox);
}
示例4: Abeja
public PictureBox Abeja()
{
PictureBox bee = new PictureBox();
bee.BackgroundImage = global::SimulacionAbejasHilos.Properties.Resources.Bee;
bee.BackColor = System.Drawing.Color.Transparent;
bee.BackgroundImage.RotateFlip(RotateFlipType.Rotate180FlipNone);
bee.Location = new System.Drawing.Point(68, 114);
bee.Size = new System.Drawing.Size(25, 22);
bee.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
bee.BringToFront();
if (this.InvokeRequired)
{
this.Invoke(new MethodInvoker(
delegate()
{
this.Controls.Add(bee);
}
));
}
else
{
this.Controls.Add(bee);
}
return bee;
}
示例5: Freeze
// freeze the form
public void Freeze()
{
// Remember we have frozen the form once more
// Do nothing if it was already frozen
if (++FreezeCount > 1)
return;
Rectangle rect = form.ClientRectangle;
if (rect.IsEmpty || form.WindowState == FormWindowState.Minimized)
return;
Point topLeft = form.PointToScreen(new Point(rect.Left, rect.Top));
// Create a PictureBox that resizes with its contents
pictureBox = new PictureBox();
pictureBox.SizeMode = PictureBoxSizeMode.AutoSize;
// create a bitmap as large as the form's client area and with same color depth
using (Graphics frmGraphics = form.CreateGraphics()) {
Bitmap bitmap = new Bitmap(rect.Width, rect.Height, frmGraphics);
hBitmap = bitmap.GetHbitmap();
pictureBox.Image = Image.FromHbitmap(hBitmap);
}
// copy the screen contents, from the form's client area to the hidden bitmap
using (Graphics picGraphics = Graphics.FromImage(pictureBox.Image)) {
picGraphics.CopyFromScreen(topLeft, Point.Empty, rect.Size, CopyPixelOperation.SourceCopy);
}
// Display the bitmap in the picture box, and show the picture box in front of all other controls
form.Controls.Add(pictureBox);
pictureBox.BringToFront();
}
示例6: dg_import_image_FileOk
private void dg_import_image_FileOk(object sender, EventArgs e)
{
PictureBox pBox = new PictureBox();
pBox.Image = Image.FromFile(this.dg_import_image.FileName);
pBox.Size = pBox.Image.Size;
pBox.Location = new Point((int)(0.5f * (this.Width - pBox.Size.Width)), (int)(0.5f * (this.Height - pBox.Size.Height)));
//pBox.Click += new EventHandler(pBox_Click);
pBox.DragDrop += new DragEventHandler(pBox_DragDrop);
this.pBoxes.Add(pBox);
this.Controls.Add(pBox);
pBox.BringToFront();
}
示例7: aboutToolStripMenuItem_Click
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
PictureBox splashImage = new PictureBox();
Form aboutFrm = new Form();
aboutFrm.ClientSize = new System.Drawing.Size(600, 400);
aboutFrm.Controls.Add(splashImage);
splashImage.ClientSize = new System.Drawing.Size(600, 400);
splashImage.BringToFront();
splashImage.BackgroundImage = new Bitmap(MedTermsFlashCardApplication.Properties.Resources.Splash);
splashImage.Show();
aboutFrm.ShowDialog();
}
示例8: CreateTerrainSlice
public void CreateTerrainSlice(int height, int x, int y)
{
y = playGround.Bottom - height;
PictureBox test = new PictureBox
{
Name = "pictureBox",
Size = new Size(1, 1),
Location = new Point(x, y),
Visible = true,
BackColor = Color.Black
};
test.Height = height;
test.BringToFront();
playGround.Controls.Add(test);
}
示例9: CreateTerrainSlice
public static PictureBox CreateTerrainSlice(int height, int x, int y)
{
y = UI.playGround.Bottom - height;
PictureBox slice = new PictureBox
{
Name = "pictureBox",
Size = new Size(1, 1),
Location = new Point(x, y),
Visible = true,
BackColor = Color.Black
};
slice.Height = height;
slice.BringToFront();
UI.playGround.Controls.Add(slice);
return slice;
}
示例10: AddNPC
void AddNPC(NPC npc)
{
// Add npc to the list
NPCNameID nameID = Program.s_npcNameIDs[npc.GameID];
ListViewItem lvi = lvNPCs.Items.Add(npc.ID.ToString() + ": " + nameID.ToString());
lvi.Tag = npc;
// Add npc to the map
PictureBox pb = new PictureBox();
SetMapMarkerRed(pb, npc);
_mapMarkers.Add(pb);
Controls.Add(pb);
pb.BringToFront();
pb.Tag = lvi;
pb.MouseClick += Pb_MouseClick;
pb.MouseMove += Pb_MouseMove;
}
示例11: AddLocation
void AddLocation(Location loc)
{
// Add npc to the list
ListViewItem lvi = lvLocations.Items.Add(loc.ID.ToString());
lvi.SubItems.Add(loc.Name);
lvi.Tag = loc;
// Add npc to the map
PictureBox pb = new PictureBox();
SetMapMarkerDark(pb, loc);
_mapMarkers.Add(pb);
Controls.Add(pb);
pb.BringToFront();
pb.Tag = lvi;
pb.MouseClick += Pb_MouseClick;
pb.MouseMove += Pb_MouseMove;
}
示例12: Enemi
//Permet de créer un enemi en multijoueur du coté client. Le client recoit la coordonnée de l'apparition de l'enemi
public Enemi(Panel panel, Point z, Boolean multi)
{
this.p.X = z.X;
this.p.Y = z.Y;
enemi = new PictureBox();
Image vaisseau = Image.FromFile(@".\enemi1.png");
enemi.Image = vaisseau;
enemi.BringToFront();
enemi.Height = 30;
enemi.Width = 60;
if (!multi)
{
enemi.BackColor = Color.Transparent;
}
enemi.Location = p;
panel.Controls.Add(enemi);
lives = 2;
}
示例13: PlayJpegsInBatchMode
public PlayJpegsInBatchMode(APPLICATION_DATA appData, Panel parentPanel, Form parentForm, int chan)
{
m_AppData = appData;
m_AppData.AddOnClosing(OnStop, APPLICATION_DATA.CLOSE_ORDER.FIRST);
m_Log = (ErrorLog)m_AppData.Logger;
m_AppData.DVRMode = APPLICATION_DATA.DVR_MODE.STORE_ON_PLATE_FOUND; // need this set for LPR to not consolidate multiple video frames
m_Channel = chan;
m_ParentForm = parentForm;
m_ParentPanel = parentPanel;
m_DisplayImagePB = new PictureBox();
m_DisplayImagePB.SizeMode = PictureBoxSizeMode.StretchImage;
m_DisplayImagePB.BackColor = Color.Black;
m_DisplayImagePB.Size = m_ParentPanel.Size;
m_ParentPanel.Controls.Add(m_DisplayImagePB);
m_DisplayImagePB.BringToFront();
}
示例14: TerrainDisplay
public TerrainDisplay(TerrainTile[,] tiles)
{
mode = Mode.Erase;
this.tilesBak = (TerrainTile[,])tiles.Clone();
this.tiles = tiles;
ClientSize = new Size(800, 800);
BackColor = Color.Blue;
WindowState = FormWindowState.Maximized;
panel = new Panel()
{
Dock = DockStyle.Fill,
AutoScroll = true,
Controls =
{
(pic = new PictureBox()
{
Image = bmp = RenderColorBmp(tiles),
SizeMode = PictureBoxSizeMode.AutoSize,
})
}
};
panel.HorizontalScroll.Enabled = true;
panel.VerticalScroll.Enabled = true;
panel.HorizontalScroll.Visible = true;
panel.VerticalScroll.Visible = true;
Controls.Add(panel);
pic2 = new PictureBox()
{
Image = bmp,
Width = 250,
Height = 250,
SizeMode = PictureBoxSizeMode.Zoom
};
Controls.Add(pic2);
pic2.BringToFront();
Text = mode.ToString();
pic.MouseMove += new MouseEventHandler(pic_MouseMove);
pic.MouseDoubleClick += new MouseEventHandler(pic_MouseDoubleClick);
}
示例15: AddTriangle
// Fenêtre Settings Général
private void AddTriangle(Button sender)
{
PictureBox PB = new PictureBox();
PB.Name = "PB_triangle";
PB.BackgroundImage = new Bitmap(ChangeImageColor_GetPixel("triangle"));
PB.Size = new Size(12, 31);
PB.BackColor = Color.White;
PB.SizeMode = PictureBoxSizeMode.Zoom;
int pX;
if (sender.Location.X < this.Width / 2)
pX = sender.Width;
else
{
pX = this.Width - sender.Width - PB.Width - 16;
PB.BackgroundImage.RotateFlip(RotateFlipType.Rotate180FlipNone);
}
PB.Location = new Point(pX, 35);
Controls.Add(PB);
PB.BringToFront();
}