picturebox

How do I draw a picturebox at run time?

放肆的年华 提交于 2019-12-12 01:23:52
问题 public void read_file(string fname) { filepath = fname; TextReader input = File.OpenText(filepath); line = input.ReadLine(); int[] ID = new int[6]; int[] x = new int[6]; int[] y = new int[6]; int xx, yy; int i = 0; image = AForge.Imaging.Image.FromFile(filename); smal1 = AForge.Imaging.Image.FromFile(smallimg1); smal2 = AForge.Imaging.Image.FromFile(smallimg2); smal3 = AForge.Imaging.Image.FromFile(smallimg3); smal4 = AForge.Imaging.Image.FromFile(smallimg4); smal5 = AForge.Imaging.Image

How to make a Rollover Image but, it stays as that image when pressed in VB.net

爷,独闯天下 提交于 2019-12-11 20:44:38
问题 I have a normal rollover image as so... 'MainMenuTab Private Sub MainMenuTabBtn_Click(sender As Object, e As EventArgs) Handles MainMenuTabBtn.Click TabControl1.SelectedTab = TabPage1 End Sub 'MainMenuTab Down Private Sub MainMenuTabBtn_MouseEnter(sender As Object, e As EventArgs) Handles MainMenuTabBtn.MouseEnter MainMenuTabBtn.Image = My.Resources.MainMenuTab_Down End Sub 'MainMenuTab Up Private Sub MainMenuTabBtn_MouseLeave(sender As Object, e As EventArgs) Handles MainMenuTabBtn

Dynamically changing image in a picturebox

梦想与她 提交于 2019-12-11 19:43:38
问题 I'd like to run a piece of code which keeps changing the picture of a picturebox (like a rotating propeller) until the form is closed. I managed to change the picture of the PictureBox with an EventHandler, but I don't know how to go along. public Form1() { InitializeComponent(); this.Controls.Add(pb); } PictureBox pb = new PictureBox { Location = new Point(0, 0), SizeMode = PictureBoxSizeMode.Zoom, Size = new Size(300,300), ImageLocation = @"E:\folder\gas_jo.png" }; private void Form1_Click

After button was pressed, get pixel properties from a picturebox only after mouse was clicked c#

心不动则不痛 提交于 2019-12-11 19:43:27
问题 I have the following code : private void Calculate_Click(object sender, EventArgs e) { if (MessageBox.Show("Please click the object in the image ", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) == DialogResult.OK) { click_the_object(); } } In the click_the_object() function I want to click a pixel in the picturebox and get it's color. The function for getting the pixel properties is : private Color culoarepixel(Point point) { Bitmap bitmap =

Display double array in picturebox

落爺英雄遲暮 提交于 2019-12-11 19:19:36
问题 I need to display this array of double in picture box in C# double[,] Y1 = new double[width, height];//not empty array contain brightness from RGB R = new byte [width, height]; G = new byte [width, height]; B = new byte [width, height]; Bitmap bmp4 = new Bitmap(width, height); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { Y1[x, y] = (0.39 * R[x,y]) + (0.59 * G[x,y]) + (0.12 * B[x,y]); Int32 zz = Convert.ToInt32(Y1[x, y]); bmp4.SetPixel(x, y, zz); } } pictureBox6.Image

C# PictureBox.SizeMode = Zoom does not redraw when assigning new images

亡梦爱人 提交于 2019-12-11 18:03:42
问题 I am working on a CCTV project which employs ONVIF. I use a Winform sample, which is provided by "ONVIF Device Manager" project, to obtain video frames from a camera. (You can find it here) It was working fine if I connect to one camera. But, if I connect to six cameras some picture box does not redraw when I assign new images in DrawFrame(). Two back rectangles contain a red ellipse in the attached picture are supposed to display an image. This issues only occur when picture box size mode is

iterating through PictureBoxes in visual c++

与世无争的帅哥 提交于 2019-12-11 17:52:25
问题 I'm programming in visual c++, and I have about 60 pictures (indexed p0...p63). I want to make a loop that goes through all the pictures and change their ImageLocation under some conditions. I figured the Tag property and one of my attempts was like this: I tagged my pictures from 0 to 63 and then tried the following: for(int i=0; i<64; i++) { PictureBox->Tag[i]->ImageLocation="possible-.gif"; } It's not working... I get this error: syntax error : missing ';' before '->' line: 1514 syntax

How to Fix this Error “A generic error occurred in GDI+”?

若如初见. 提交于 2019-12-11 17:36:56
问题 Open An Image from default name and save it by default name.(overwrit it) I need make graphics from Image("Default.jpg") that put it on picturebox1.image and draw some graphic on picurebox1.(it works and it is not my problem) But I can't save picturebox1.Image overwrite on "Default.jpg"(this is My problem).If I change the save name it work but I need to overwrite it and open it manytimes. Thank You Boolean Play = false; Pen P = new Pen(Color.Black, 2); Graphics Temp; int X1, X2, Y1, Y2; Image

How to save as picture?

时间秒杀一切 提交于 2019-12-11 16:53:21
问题 I just created a simple webpage in which there is a PictureBox inside a Panel, the PictureBox allow users to import picture, and the Panel allow the user to insert color, so how can i export / save it as .jpeg file? 回答1: pictureBox1.Image.Save(filePath, ImageFormat.Jpeg); Check this MSDN reference for further knowledge. 回答2: Here is my solution with additional support to various file types: public void ExportToBmp(string path) { using(var bitmap = new Bitmap(pictureBox.Width, pictureBox

How to display image from datagridview to picturebox?

妖精的绣舞 提交于 2019-12-11 16:31:59
问题 I need some help to display images from my datagridview to my picturebox, can someone please help me? I'm very new to this. To this site as well. I've used this to save the images private void button1_Click(object sender, EventArgs e) { byte[] imageBt = null; FileStream fstream = new FileStream(this.afbeelding_txt.Text, FileMode.Open, FileAccess.Read); BinaryReader br = new BinaryReader(fstream); imageBt = br.ReadBytes((int)fstream.Length); string constring = "datasource=localhost;port=3306