Re: Coordination Screenshot
I think you mean "coordinates" rather than "coordination". If so then you need to use the Bounds property of Form2 rather than of Screen.PrimaryScreen.
Re: Coordination Screenshot
yes,like hare in the video:
http://www.youtube.com/watch?v=SLJiSG5aQ3g
(5:20 - 5:50 mins)
u can give me example?
Re: Coordination Screenshot
Re: Coordination Screenshot
I already told you what you need to do: use the Bounds property of the form. What exactly is the problem?
Re: Coordination Screenshot
want to do it in Form2, you can give me an example code?
Re: Coordination Screenshot
You've already got example code. You posted it yourself. You just need to change it as I have already suggested.
Quote:
use the Bounds property of Form2 rather than of Screen.PrimaryScreen
Re: Coordination Screenshot
I do not understand, what is the code?
Code:
graph.CopyFromScreen(form2.X, form2.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
?
Re: Coordination Screenshot
Did you write that code yourself? If so you should understand what jm means.
Here he means something like this I think but I didnt read your case.
Code:
Dim bounds As Rectangle = Form2.Bounds
Dim screenshot As System.Drawing.Bitmap = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
Dim Graph As Graphics= Graphics.FromImage(screenshot)
Graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
PictureBox1.Image = screenshot
Re: Coordination Screenshot
Quote:
Originally Posted by
Skatebone
Did you write that code yourself? If so you should understand what jm means.
Here he means something like this I think but I didnt read your case.
Code:
Dim bounds As Rectangle = Form2.Bounds
Dim screenshot As System.Drawing.Bitmap = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
Dim Graph As Graphics= Graphics.FromImage(screenshot)
Graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
PictureBox1.Image = screenshot
Thanks but that's not accurate, it takes all the screen and not just the part I want (I want mark it with Form2 course)
Re: Coordination Screenshot
Re: Coordination Screenshot
You need to use the Bounds of the form you want. That code is using the default instance of Form2 to get the Bounds. Is it the default instance that you displayed in the first place? If you don;t know what a default instance is, follow the Blog link in my signature and read my post on the subject.
Re: Coordination Screenshot
I do not see, you can give me a link?
Re: Coordination Screenshot
I already have.
Quote:
the Blog link in my signature
Re: Coordination Screenshot