本文整理汇总了C#中System.Windows.Forms.PictureBox.Show方法的典型用法代码示例。如果您正苦于以下问题:C# PictureBox.Show方法的具体用法?C# PictureBox.Show怎么用?C# PictureBox.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.PictureBox
的用法示例。
在下文中一共展示了PictureBox.Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawProfileBox
public void DrawProfileBox(PictureBox NPCProfileBox)
{
SetProfileBMP(GetProfile());
NPCProfileBox.Image = GetProfileBMP();
NPCProfileBox.Show();
NPCProfileBox.Refresh();
}
示例2: AddScreenshot
public void AddScreenshot(Image Screenshot)
{
try
{
PictureBox nPB = new PictureBox();
nPB.MouseDown += pbScreenshot_MouseDown;
nPB.Parent = flpScreenshots;
nPB.SizeMode = PictureBoxSizeMode.StretchImage;
nPB.BorderStyle = BorderStyle.FixedSingle;
nPB.ContextMenuStrip = cMenScreenshot;
nPB.Image = Screenshot;
nPB.Size = new Size(100, 100); //New Size((Screenshot.Width / 100) * 20, (Screenshot.Height / 100) * 20)
nPB.Show();
Button nBtn = new Button();
nBtn.Click += btnCloseScreenshot_Click;
nBtn.Parent = nPB;
nBtn.FlatStyle = FlatStyle.Flat;
nBtn.Text = "×";
nBtn.Size = new Size(22, 22);
nBtn.Location = new Point(nPB.Width - nBtn.Width, -1);
nBtn.Show();
Show(frmMain.Default.pnlDock);
}
catch (Exception ex)
{
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "AddScreenshot (UI.Window.ScreenshotManager) failed" + Environment.NewLine + ex.Message, true);
}
}
示例3: DrawCharacter
public void DrawCharacter(PictureBox CharPictureBox, PictureBox MapPictureBox)
{
SetSpriteBMP(SelectSprite(GetSprite(), 1, Direction));
CharPictureBox.Show();
CharPictureBox.Location = new Point(X_Location * 32, Y_Location * 32);
CharPictureBox.Parent = MapPictureBox;
CharPictureBox.Image = GetSpriteBMP();
}
示例4: 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();
}
示例5: Pic
public PictureBox Pic()
{
List<Bitmap> imagens = new List<Bitmap>();
imagens.Add(Properties.Resources._1_0);
PictureBox pic = new PictureBox();
pic.Cursor = Cursors.Hand;
pic.Location = new Point(12, 12);
pic.Name = "pcb";
pic.Size = new Size(50, 50);
pic.SizeMode = PictureBoxSizeMode.AutoSize;
//pic.Image = Properties.Resources._10_0;
pic.Image = imagens[0];
pic.Show();
return pic;
}
示例6: seriousNamesComeOnRobert
private void seriousNamesComeOnRobert(string fileExt)
{
string path = @"C:\ProjectSnowshoes\User\" + Properties.Settings.Default.username[Properties.Settings.Default.whoIsThisCrazyDoge] + @"\Pictures";
for (int i = 0; i < Directory.GetFiles(path, fileExt, SearchOption.AllDirectories).Length; i++)
{
FileInfo fiInf = new FileInfo(Directory.GetFiles(path, fileExt, SearchOption.AllDirectories)[i]);
char[] separator = new char[] { '.' };
string str2 = fiInf.Name.Split(separator)[0];
Panel panel = new Panel();
panel.Show();
panel.BackColor = Color.Transparent;
panel.Left = 0;
panel.Width = 180;
panel.Height = 110;
panel.Margin = new Padding(10);
this.imagePanel.Controls.Add(panel);
PictureBox box = new PictureBox();
box.Show();
box.Width = 160;
box.Height = 90;
box.Left = 10;
box.BackgroundImage = Image.FromFile(fiInf.FullName);
box.BackgroundImageLayout = ImageLayout.Zoom;
panel.Controls.Add(box);
Label label = new Label();
label.Show();
label.Width = 170;
label.AutoEllipsis = true;
label.Height = 14;
label.TextAlign = ContentAlignment.MiddleCenter;
label.Font = new Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 11f);
label.BackColor = Color.Transparent;
label.ForeColor = Color.DarkGray;
label.Left = 5;
label.Text = str2;
label.Top = 0x5d;
panel.Controls.Add(label);
panel.Click += (senderA, args) => Process.Start(fiInf.FullName);
box.Click += (senderA, args) => Process.Start(fiInf.FullName);
label.Click += (senderA, args) => Process.Start(fiInf.FullName);
}
}
示例7: timerYolcuBinis_Tick
private void timerYolcuBinis_Tick(object sender, EventArgs e)
{
if ((pbYolcular2.Count < 1 || pbYolcular2.Last<PictureBox>().Location.X > 45)
&& pbYolcular2.Count < bindirilecekYolcuSayisi)
{
PictureBox yolcu = new PictureBox();
yolcu.Location = new Point(0, 208);
yolcu.Size = new System.Drawing.Size(42, 61);
rand = rnd.Next(1, 5);
yolcu.Image = Image.FromFile("resimler\\eleman" + rand.ToString() + ".png");
yolcu.BackColor = Color.Transparent;
pbYolcular2.Add(yolcu);
yolcu.Show();
this.Controls.Add(yolcu);
}
else
{
foreach (PictureBox y in pbYolcular2)
{
y.Location = new Point(y.Location.X + 5, y.Location.Y);
if (y.Location.X > 280) y.Hide();
}
}
if (pbYolcular2.Count == bindirilecekYolcuSayisi &&
pbYolcular2.Last<PictureBox>().Location.X > 256)
{
foreach (PictureBox y in pbYolcular2)
{
y.Dispose();
}
pbYolcular2 = null;
timerYolcuBinis.Stop();
timerUcakKalkis2.Start();
}
if (pbYolcular2 == null)
{
timerYolcuBinis.Stop();
}
}
示例8: Main
//.........这里部分代码省略.........
rgbValues[thisPixel] = (byte)colorB;
}
dR = randomR.Next(redCenter, redTop);
dG = randomR.Next(greenCenter, greenTop);
dB = randomR.Next(blueCenter, blueTop);
colorR = (int)Math.Truncate(dR);
colorG = (int)Math.Truncate(dG);
colorB = (int)Math.Truncate(dB);
}
System.Runtime.InteropServices.Marshal.Copy(rgbValues, 0, ln1, bytes);
bm.UnlockBits(bmpData);
// int Height = 1300;
// int Width = 2000;
Form MainForm = new Form();
MainForm.AutoSize = true;
MainForm.MinimumSize = new Size(Width,Height);
MainForm.Activate();
MainForm.Show();
PictureBox pb = new PictureBox();
MainForm.Controls.Add(pb);
MainForm.WindowState=System.Windows.Forms.FormWindowState.Maximized;
pb.Size = new Size(Width, Height);
pb.Show();
int seventeen = myRandom.Next(1,2);
// switch ( seventeen )
//
// {
//
// case 1 :
// pb.BackColor = System.Drawing.Color.White;
// break;
// case 2 :
//pb.BackColor = System.Drawing.Color.Black;
// break;
//
// }
int i;
int randomNumber; randomNumber = random.Next(0, 255);
示例9: ScanCompute
private void ScanCompute()
{
foreach (TaskGroup g in task.TaskGroups)
{
PictureBox p = new PictureBox();
p.Width=252;
p.Height = 142;
p.Load(g.OriginalImageFileName);
p.SizeMode = PictureBoxSizeMode.StretchImage;
OriginalImage.Load(g.OriginalImageFileName);
p.Show();
ChartArea chartArea1 = new ChartArea();
chartArea1.Name="ChartArea1";
Legend legend1 = new Legend();
legend1.Name = "Legend1";
Series series1 = new Series();
Series series2 = new Series();
Chart chart = new Chart();
chart.ChartAreas.Add(chartArea1);
chart.Legends.Add(legend1);
series1.ChartArea = "ChartArea1";
series1.Legend = "Legend1";
series1.Name = "PSNR";
series1.ChartType = SeriesChartType.Line;
series2.ChartArea = "ChartArea1";
series2.Legend = "Legend1";
series2.Name = "SSIM";
series2.ChartType = SeriesChartType.Line;
chart.Series.Add(series1);
chart.Series.Add(series2);
chart.Size = new System.Drawing.Size(375, 142);
chart.Show();
foreach (TaskItem item in g.TaskItems)
{
double distortionLevel = 0;
bool doProcess = false;
switch (distortionType)
{
case "blur":
doProcess = (item.BlurLevel > 0 && item.JpegLevel == 0 && item.NoiseLevel == 0);
distortionLevel = item.BlurLevel;
break;
case "noise":
doProcess = (item.NoiseLevel > 0 && item.JpegLevel == 0 && item.BlurLevel == 0);
distortionLevel = item.NoiseLevel;
break;
case "jpeg":
doProcess = (item.JpegLevel > 0 && item.NoiseLevel== 0 && item.BlurLevel == 0);
distortionLevel = item.JpegLevel;
break;
case "blur_jpeg":
doProcess = (item.JpegLevel > 0 && item.BlurLevel > 0 && item.NoiseLevel == 0);
distortionLevel = (double)(item.JpegLevel + item.BlurLevel) / 2;
break;
case "blur_noise":
doProcess = (item.BlurLevel > 0 && item.NoiseLevel > 0 && item.JpegLevel == 0);
distortionLevel = (double)(item.BlurLevel + item.NoiseLevel) / 2;
break;
}
if (doProcess)
{
compressedImage.Load(item.FileName);
Bitmap bm = (Bitmap)OriginalImage.Image;
Bitmap originalBitMap = new Bitmap(OriginalImage.Image);
Bitmap compressedBitMap = new Bitmap(compressedImage.Image);
int width = OriginalImage.Image.Width;
int height = OriginalImage.Image.Height;
int modW = width % 8;
int modH = height % 8;
int newWidth = width;
if (modW > 0)
{
newWidth = width + (8 - modW);
}
int newHeight = height;
if (modH > 0)
{
newHeight = height + (8 - modH);
}
Bitmap newOrBitmap = new Bitmap(newWidth, newHeight);
Bitmap newPrBitmap = new Bitmap(newWidth, newHeight);
Graphics graphicOrImage = Graphics.FromImage(newOrBitmap);
Graphics graphicPrImage = Graphics.FromImage(newPrBitmap);
graphicOrImage.DrawImage(originalBitMap, 0, 0, width, height);
graphicPrImage.DrawImage(compressedBitMap, 0, 0, width, height);
List<Bitmap> orBlockArray = new List<Bitmap>();
List<Bitmap> prBlockArray = new List<Bitmap>();
for (int i = 0; i < newWidth / 8; i++)
{
//.........这里部分代码省略.........
示例10: addElement
private void addElement(int x, int y, string image)
{
p = new PictureBox();
p.Image = new Bitmap(image + ".png");
p.Location = new Point(x, y);
p.SizeMode = PictureBoxSizeMode.AutoSize;
p.Show();
this.Controls.Add(p);
p.BringToFront();
elements.Add(p);
}
示例11: setWarnState
private void setWarnState(PictureBox image)
{
image.Show();
}
示例12: Main
static void Main()
{
int Height = Screen.PrimaryScreen.WorkingArea.Height;
int Width = Screen.PrimaryScreen.WorkingArea.Width;
Form MainForm = new Form();
MainForm.AutoSize = true;
MainForm.MinimumSize = new Size(Width,Height);
MainForm.Activate();
MainForm.BackColor = System.Drawing.Color.White;
MainForm.Top = Screen.PrimaryScreen.WorkingArea.Top;
MainForm.Left = Screen.PrimaryScreen.WorkingArea.Left;
MainForm.Show();
PictureBox pb = new PictureBox();
MainForm.Controls.Add(pb);
pb.Size = new Size(Width, Height);
pb.Show();
pb.BackColor = System.Drawing.Color.White;
int i;
Random random = new Random();
int randomNumber; randomNumber = random.Next(0, 255);
Point ptStart = new Point(random.Next(0, Width), random.Next(0, Height));
System.Drawing.Graphics Drawer = pb.CreateGraphics();
for (i=0; i<50000; i++)
{
Pen pn = new Pen( System.Drawing.Color.FromArgb(random.Next(0, 255),
random.Next(0, 255),
random.Next(0, 255)), random.Next(0,70) );
Point ptEnd = new Point(random.Next(0, Width), random.Next(0, Height));
Drawer.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
Drawer.DrawBezier(pn, ptStart, new Point(random.Next(0, Width), random.Next(0, Height)),
new Point(random.Next(0, Width), random.Next(0, Height)),
ptEnd);
//Point[] pts = {ptStart, new Point(random.Next(0, Width), random.Next(0, Height)),
// new Point(random.Next(0, Width), random.Next(0, Height)),
// ptEnd};
//Drawer.DrawPolygon(pn,pts);
ptStart = ptEnd;
//pn.Dispose();
}
}
示例13: addElement
private PictureBox addElement(int x, int y, string image)
{
_p = new PictureBox();
switch (image)
{
case "car North":
_p.Image = Properties.Resources.carN;
break;
case "car East":
_p.Image = Properties.Resources.carE;
break;
case "car West":
_p.Image = Properties.Resources.carW;
break;
case "car South":
_p.Image = Properties.Resources.carS;
break;
case "Color [Red]":
_p.Image = Properties.Resources.redLight;
break;
case "Color [Green]":
_p.Image = Properties.Resources.greenLight;
break;
case "mergingN":
_p.Image = Properties.Resources.mergingN;
break;
case "mergingE":
_p.Image = Properties.Resources.mergingE;
break;
case "mergingS":
_p.Image = Properties.Resources.mergingS;
break;
case "mergingW":
_p.Image = Properties.Resources.mergingW;
break;
case "Traffic_Simulator.Crossing_1":
_p.Image = Properties.Resources.Traffic_Simulator_Crossing_1;
break;
case "Traffic_Simulator.Crossing_2":
_p.Image = Properties.Resources.Traffic_Simulator_Crossing_2;
break;
case "pedColor [Green]":
_p.Image = Properties.Resources.pedColor__Green_;
break;
case "pedColor [Red]":
_p.Image = Properties.Resources.pedColor__Red_;
break;
}
//_p.Image = new Bitmap(image + ".png");
_p.Location = new Point(x, y);
_p.SizeMode = PictureBoxSizeMode.AutoSize;
_p.Show();
this.Controls.Add(_p);
_p.BringToFront();
_elements.Add(_p);
return _p;
}
示例14: FrameForm
public FrameForm(Screen s)
{
InitializeComponent();
/* Set Form Positioning in Secondary Window */
this.Left = s.Bounds.Left;
this.Top = s.Bounds.Top;
this.Size = s.Bounds.Size;
this.WindowState = FormWindowState.Maximized;
/* Create Right Click Menu */
ContextMenu cxtMnu = new ContextMenu();
this.mi_playCtrl = new MenuItem("Pause", mi_playCtrl_Clicked);
cxtMnu.MenuItems.Add(this.mi_playCtrl);
cxtMnu.MenuItems.Add("-");
cxtMnu.MenuItems.Add("Close Frame", delegate(object sndr, EventArgs e) { this.Close(); });
this.ContextMenu = cxtMnu;
/* Load Image Settings */
this.t_imgTransition = new Timer();
this.t_imgTransition.Tick += t_imgTransition_Tick;
LoadSettings();
/* Initiate Picture Boxes */
#if DEBUG
System.Diagnostics.Debug.Print("Initialize picbx_visible");
#endif
img_idx = 0;
picbx_visible = new PictureBox();
picbx_visible.Parent = this;
picbx_visible.Size = this.Size;
picbx_visible.Location = new Point(0, 0);
picbx_visible.Hide();
if (imageList.Length > 0)
picbx_visible.Image = Image.FromFile(imageList[0]);
#if DEBUG
System.Diagnostics.Debug.Print("Initialize picbx_next");
#endif
picbx_next = new PictureBox();
picbx_next.Parent = this;
picbx_next.Size = this.Size;
picbx_next.Location = new Point(0, 0);
picbx_next.Hide();
if (imageList.Length > 1)
picbx_next.Image = Image.FromFile(imageList[1]);
#if DEBUG
System.Diagnostics.Debug.Print(picbx_next.Parent.ToString());
#endif
picbx_visible.FitContainer();
picbx_visible.Center();
picbx_visible.Show();
Properties.Settings.Default.SettingsSaving += delegate(object sndr, CancelEventArgs e){ LoadSettings(); };
/* Start Timer */
this.t_imgTransition.Start();
}
示例15: AddPictureBox
/// <summary>
/// 画出图片
/// </summary>
/// <param name="img">图片</param>
/// <param name="left">左边</param>
/// <param name="top">上边</param>
private void AddPictureBox(Image img, int left, int top)
{
PictureBox pb = new PictureBox();
pb.Image = img;
pb.Location = new System.Drawing.Point(left, top);
pb.Cursor = Cursors.SizeAll;
pb.BorderStyle =BorderStyle.FixedSingle ;
pb.Name = "pb_" + left + "_" + top;
pb.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
pb.Click += pb_Click;
pb.MouseDown += pb_MouseDown;
pb.MouseMove += pb_MouseMove;
pb.MouseUp += pb_MouseUp;
//pb.Paint += pb_Paint;
panelImages.Controls.Add(pb);
pb.Show();
}