picturebox

Moving PictureBox using Timer

假如想象 提交于 2021-02-10 20:15:19
问题 Basically what I'm trying to do is to make a picture box go up, then left, then down, then right, all based on timer ticks. I'm fairly new so I don't really know what's wrong. If you guys could give a simple answer or a better approach, that'd be great. Dim slides As Integer slides += 10 If slides < 20 Then PictureBox1.Left += 10 ElseIf slides > 20 AndAlso slides < 40 Then PictureBox1.Top += 10 ElseIf slides > 40 AndAlso < 60 Then PictureBox1.Left -= 10 ElseIf slides > 60 AndAlso < 80 Then

C# WindowsForms PictureBox: Transformation between control coordinates and pixel position in image

扶醉桌前 提交于 2021-02-10 16:08:33
问题 I have a control with a PictureBox within it. The PictureBox displays an image (in Zoom mode, at least in this particular case). I need to do two kinds of things: Click with the mouse and find out which pixel of the image I hit Draw a vertical line over the PictureBox at a given column in the image. Obviously, I need some kind of coordinate transformations between the control coordinates and the (row, column) of the pixel in the image. The first one I may have found (www.codeproject.com

C# WindowsForms PictureBox: Transformation between control coordinates and pixel position in image

倖福魔咒の 提交于 2021-02-10 16:07:28
问题 I have a control with a PictureBox within it. The PictureBox displays an image (in Zoom mode, at least in this particular case). I need to do two kinds of things: Click with the mouse and find out which pixel of the image I hit Draw a vertical line over the PictureBox at a given column in the image. Obviously, I need some kind of coordinate transformations between the control coordinates and the (row, column) of the pixel in the image. The first one I may have found (www.codeproject.com

I want to make a picturebox disappear after a certain time has passed without using a control

大兔子大兔子 提交于 2021-02-08 11:24:18
问题 Hello I am kind of new to C#... I have a picturebox which is my control. It's meant to be rapidly clicked on. I want to make it so when it is clicked a certain amount of times a second picturebox which has a .gif in it becomes visible. And when a certain amount of time has past without clicking the first picturebox the second disappears. Is there a way to do this? Maybe with timers. Some sample code will help me out A LOT! Thanks to all in advance! :) 回答1: Try This: System.Windows.Forms.Timer

Grayscale image from binary data

丶灬走出姿态 提交于 2021-02-08 08:58:22
问题 I'm working on some simple viewer app for CT images. Let's say I have array of 262144 Int16 values. Each value represents one pixel in 512x512 image. Each pixel has value from 0 to 4096 where 0 is black and 4096 is white. Is there any elegant, simple solution to display this image in Visual Studio Picture Box? Maybe some kind of MemoryReader or Stream? I've tried to search for some solution but found only topic about retrieving binary data from databases. 回答1: A good way and with a good

error when i'm trying to delete an image used in a picturebox

∥☆過路亽.° 提交于 2021-02-05 08:09:21
问题 I'm using visual studio 2013 to create a c# windows application and I'm facing this error. When I'm trying to delete an image that I have been using in a picturebox this error message appears..: System.IO.IOException: The process cannot access the file 'C:\Users\ALI PC\Documents\My Projects\Doctor Clinic\Doctor Clinic\Images\1.jpg' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path,

How to flip a User Control added in a picturebox by 180 degrees?

大憨熊 提交于 2021-01-29 10:11:12
问题 I'm adding a control to a picturebox. This control is a component, precisely it's a toggle switch posted here. I'd like this control to be vertical and not horizontal . So, since objects can't be rotated or flipped, I found a way to flip the picturebox image with: PictureBox1.Image.RotateFlip(RotateFlipType.Rotate180FlipNone) PictureBox1.Refresh() The error I'm getting at RunTime is: System.Windows.Forms.PictureBox.Image.get returned Nothing Endeed the control is not an image so is there a

Adding picture boxes dynamically in VB.Net

只愿长相守 提交于 2021-01-28 02:50:49
问题 I'm sure there is someone out there who can explain this clearly. I would have assumed that I could simply use: Dim pb As PictureBox then I could use pb = New PictureBox but apparently not. I would also assume I can set parameters pb.Width pb.Height pb.Top pb.Left etc. If anyone can help me create a picture box dynamically where I can set the properties I would be so grateful, thanks. I'm also sorry if this question has already been asked, but I have been looking for a few hours now and

Does a picturebox not support keyboard events?

两盒软妹~` 提交于 2020-12-26 09:05:47
问题 I am currently using Visual Studio, and I don't know if this is a glitch or not, but when I go into the form properties, and show the events, there are two events called KeyDown and KeyUp . Now when I do the same for a PictureBox , it has way less events and no KeyDown and KeyUp events. Does the PictureBox support less events then other things? Is this a glitch? Screenshot of Form1 properties: Screenshot of PictureBox1 properties: 回答1: Its not a glitch. Its the way it is. You don't type in

Does a picturebox not support keyboard events?

淺唱寂寞╮ 提交于 2020-12-26 09:02:36
问题 I am currently using Visual Studio, and I don't know if this is a glitch or not, but when I go into the form properties, and show the events, there are two events called KeyDown and KeyUp . Now when I do the same for a PictureBox , it has way less events and no KeyDown and KeyUp events. Does the PictureBox support less events then other things? Is this a glitch? Screenshot of Form1 properties: Screenshot of PictureBox1 properties: 回答1: Its not a glitch. Its the way it is. You don't type in