picturebox

How to create multiple picture boxes and keep them?

末鹿安然 提交于 2019-12-10 10:57:59
问题 I want to create an ability for the user in my app to create pictureboxs everytime the user clicks on the main picturebox (I want to keep the pictureboxs and give an infinity picturebox creating ability to the User) The code: PictureBox Pic = new PictureBox(); Pic = pictureBox2; Pic.Left = e.X; Pic.Top = e.Y; Pic.Visible = true; 回答1: you need to register to the event of clicking the pictureBox and create a new pirtureBox when clicking on it: this.pictureBox1 = new System.Windows.Forms

Picturebox slider control transparency

杀马特。学长 韩版系。学妹 提交于 2019-12-10 10:29:16
问题 I've a PictureBox in my form and load a image in it. I need this PictureBox to change the transparency (opacity, visibilit..etc), because I need the user to see the image behind this PictureBox better, so when he wants, he just drag the control slider and the image starts to turn invisible, step by step, until he finds its ok, lets say 50% transparency. I added the control slider but, cant find the way to do the rest. I tried the pictureBox.Opacity, pictureBox.Transparency, nothing works. 回答1

how to put an Iplimage on a picturebox?

早过忘川 提交于 2019-12-10 09:44:46
问题 Is there a way to show an IplImage in a picturebox? I'd like to not save the image and reload it into the picturebox since I need my program to be fast. I'm using opencv 2.1 in C++. I'm working with Visual Studio 2008. Thank you. 回答1: This was already discussed here: IplImage* img=cvLoadImage("sample.jpg",3); // for example HDC hdc = picturebox.GetDC()->m_hDC; char m_chBmpBuf[2048]; BITMAPINFO *m_pBmpInfo =0; m_pBmpInfo = (BITMAPINFO *)m_chBmpBuf; m_pBmpInfo->bmiHeader.biSize = sizeof

How to convert image to puzzle? [closed]

纵饮孤独 提交于 2019-12-10 00:19:43
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I Want the program get a pic of user ,then convert image to puzzle (for example 100 piece) then make 100 picture box. I using this following code for 4 and 9 piece. if (Image_Num.SelectedIndex == 0) { PB = new PictureBox[4]; int W, H; var imgarray = new Image[4]; var img = User

Popping up a TextBox on mouse click over a PictureBox for adding custom note to picture

时光总嘲笑我的痴心妄想 提交于 2019-12-08 21:24:37
In my C# winforms application, I have a picturebox which some bitmap images can be loaded into it. What I want to do is if user clicks somewhere within picturebox, at the mouse location a small textbox will be appeared and user can add a custom text (note) to the picture. I know how to write a string into a bitmap file, but I couldnt find a way to POP UP a textbox at mouse location, and automaticly add the text to the image when user wrote something and hit enter key. How this textbox and its properties should be defined? Thanks. You could embed a control in a custom popup form, as shown below

How to show Image from byte array in Microsoft report

早过忘川 提交于 2019-12-08 18:48:23
问题 I am using a Report file and a ReportViewer control to show a report which loads data dynamically from objects during run-time. I need to show an image which is stored as a byte array in the object. The PictureBox's value is currently set to: =First(Fields!ImageData.Value, "dtstItemImage") And I set the DataSource using: ImageBindingSource.DataSource = this.item.Image.ImageData; The code compiles and runs but the image is not displayed in the report . Is this because the PictureBox needs to

Accessing an image resource by name and assigning it to a PictureBox

烈酒焚心 提交于 2019-12-08 14:05:41
I have this list: List<string> list = new List<string>(); list.Add("dog.jpg"); list.Add("cat.jpg"); list.Add("horse.jpg"); In my resources, I have 3 images named: dog, cat, and horse. I want to display them in a picture box using the list. I have tried something like this: pictureBox1.Image = project.Properties.Resources.list[2]; // should display the horse image The problem is that it displays the error: 'Resources' does not contain a definition for 'list' ` How can I get the image using the name in the list? Haytam Properties.Resources only knows the resources (dog, cat, and horse) so you

Unlocking image from PictureBox

北战南征 提交于 2019-12-08 14:04:24
问题 I'm currently developing an application to help scanning and showing images here at my work. My application is build with multiple forms, the most important forms here is my mainForm to show statistics about the current scanning and a menustrip with different functinalities. I also have ImageViewerForm with a PictureBox which shows on the secondary monitor to view the current scanned image. I'm using a Timer to poll the folder where the images are scanned to. When a new image has been scanned

Show the picture from database to each usercontrol's picturebox?

此生再无相见时 提交于 2019-12-08 12:18:45
问题 Usercontrol Code: private string lastName; public string LastName { get { return lastName; } set { lastName = value; textBox1.Text = value; } } Form Code: using (SqlConnection myDatabaseConnection = new SqlConnection(myConnectionString.ConnectionString)) { myDatabaseConnection.Open(); using (SqlCommand SqlCommand = new SqlCommand("Select LastName, Image from Employee", myDatabaseConnection)) { int i = 0; SqlDataReader DR1 = SqlCommand.ExecuteReader(); while (DR1.Read()) { i++; UserControl2

Display a number of usercontrol based on the number of records in the database

时光毁灭记忆、已成空白 提交于 2019-12-08 11:42:52
问题 . The black box is a usercontrol. Usercontrol Code string b = ""; public string ID { set { b = value; } } public void sample() { textBox1.Clear(); using (SqlConnection myDatabaseConnection = new SqlConnection(myConnectionString.ConnectionString)) { myDatabaseConnection.Open(); using (SqlCommand SqlCommand = new SqlCommand("Select LastName, Image from Employee where ID = @a", myDatabaseConnection)) { SqlCommand.Parameters.AddWithValue("@a", b); DataSet DS = new DataSet(); SqlDataAdapter da =