picturebox

c# picturebox memory releasing problem

允我心安 提交于 2019-12-04 01:03:35
问题 I'm a newby in C#. I have to repeatedly refresh a GUI picture box in a worker thread. The image is acquired from a camera polling a driver with a GetImage method that retrives the image to be displayed. Even if I allocate the bitmap using directive "using" and explicitly call G.C, memory seems to be never deallocated. The worker thread is something like this: while (true) { // request image with IR signal values (array of UInt16) image = axLVCam.GetImage(0); lut = axLVCam.GetLUT(1);

Move a PictureBox with mouse

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 22:06:33
问题 I'm developing an app for windows mobile (Compact Framework 2.0). It has a WinForms with a PictureBox. I want to move the image of the PictureBox but I don't know how to do it so I choose to move the hole PictureBox. To do it I use this event: private void imagenMapa_MouseMove(object sender, MouseEventArgs e) { imagenMapa.Left = e.X; imagenMapa.Top = e.Y; this.Refresh(); } But when I move the PictureBox it blinks and moves every where. What I'm doing wrong? 回答1: The e.X and e.Y are relative

Picture box to byte array

徘徊边缘 提交于 2019-12-03 16:18:00
I have a program to select an image and to set that selected image in a picture box then convert the image in the image box to byte array and save sql server data base in a image type column. In browse button click event I'm selecting the image file like this. OpenFileDialog fop = new OpenFileDialog(); fop.InitialDirectory = @"Desktop"; fop.Filter = "image files|*.jpg;*.png;*.gif"; if (fop.ShowDialog() == DialogResult.OK) { FileStream FS = new FileStream(@fop.FileName, FileMode.Open, FileAccess.Read); pbPartySymbol.Image = new Bitmap(fop.FileName); MessageBox.Show("Image Imported Successfully!

Is it possible to have two overlapping PictureBox controls with transparent images? [duplicate]

你。 提交于 2019-12-03 05:18:35
This question already has answers here : Transparent images with C# WinForms (6 answers) Having two overlapping PictureBox controls , I'm trying to make the transparent areas of the picture box let the controls below (in the z-order) being visible. Even after trying what Microsoft suggests , I cannot get the desired result. This is what I currently have: And this is what I want: So my question is: Any way to achieve my desired result with two PictureBox controls (or with another way) that overlap each other and let the transparent areas shine through? Update: Actually I solved it by using this

retrieving image from database

蓝咒 提交于 2019-12-02 22:00:04
问题 I'm working on my project which displays a list of employee. here, the information and picture of the employee will be shown. my project can now show the list of employees in the listbox and when I double click on an employee, his/her profile will be shown on a textbox. my problem is that i can't make their pictures to show in the picturebox . I already stored their picture on a table in my database along with their id, name, and profile. It only shows the picture of the first employee on the

Creating numerous PictureBoxes by code - only one is visible

不想你离开。 提交于 2019-12-02 19:58:53
问题 I am trying to draw lots of instances of an image using the following code: PictureBox[] sprites = new PictureBox[100]; private void Game_Load(object sender, EventArgs e) { PictureBox mainSprite = new PictureBox(); Bitmap img = new Bitmap(SpriteTest.Properties.Resources.Image); //Load a png image mainSprite.Size = new Size(16, 16); mainSprite.Image = img; for(var i = 0; i < sprites.Length; i++) { sprites[i] = mainSprite; //Keeping it simple for now with a single row of sprites sprites[i]

Out of memory exception in c# when drawing trains in picturebox

南笙酒味 提交于 2019-12-02 18:13:31
问题 I am trying to create an application that shows the online trains in picturebox So to implement this i create a worker thread to get the online train position .so i define the thread as you can see here : private Thread workerThread = null; private delegate void UpdateListBoxDelegate(); private UpdateListBoxDelegate UpdateListBox = null; In Form_load i call these: UpdateListBox = new UpdateListBoxDelegate(this.UpdateStatus); // Initialise and start worker thread workerThread = new Thread(new

VB.NET Picturebox on top of MDI Child

喜欢而已 提交于 2019-12-02 17:56:20
问题 Any idea why a picturebox in a MDI parent would show on top of a MDI child? (even when MDI child = topmost) When calling picturebox.SendToBack the picturebox disappears in the MDI parent. 回答1: What I did was, created a borderless form with the picturebox on it, and threw it on the MDI parent as a MDI child, seems to do the job! 来源: https://stackoverflow.com/questions/7814968/vb-net-picturebox-on-top-of-mdi-child

How do I rotate a picturebox around a point?

人盡茶涼 提交于 2019-12-02 15:17:57
问题 Solved I am trying to simulate a planet rotating a star. I am currently aware of the syntax to move the picture box (I have this in a timer so it is repeated) private void rotate_timer(object sender, EventArgs e) { picturebox1.location = new point (picturebox1.location.x + 1, picturebox1.location.y + 1); } But I don't know where to start so that it rotates around a specific point. How would I go about rotating it around (0,0)? 回答1: This may help: float angle = 0; float rotSpeed = 1; Point

Animated GIF in Windows Form while executing long process

给你一囗甜甜゛ 提交于 2019-12-02 13:40:07
问题 I have developed a simple windows Application(MDI) in C# which exports the data from SQL to Excel. I am using ClosedXML to achieve this successfully. When the process is executed, I want to show a picturebox containing a animated GIF image. I am a beginner and don't know how to achieve this, the picturebox appears after the process is completed. I saw lot of posts which says to use backgroundworker or threading which I have never used and finding it hard to implement. Can I have an step by