Picture Taker-How to take a snapshot of a certain space

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
5 posts Page 1 of 1
Contributors
User avatar
Robby
VIP - Donator
VIP - Donator
Posts: 417
Joined: Mon Aug 03, 2009 4:01 am

Hi there,

I need a bit of your help for a Picture Viewer i m coding in VB. It is coming out good so far but i need help for just 1 little thing.. How can i take a snapshot of just my icons...
You wont know wat i mean there but i mean is like how do i just take a snapshot of a small place rather than my whole screen btw i m using this code also found in other tutorials and all but yea i m using this code
Code: Select all
Dim bounds As Rectangle
         Dim screenshot As System.Drawing.Bitmap
        Dim graph As Graphics
        bounds = Screen.PrimaryScreen.Bounds
        screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
        graph = Graphics.FromImage(screenshot)
        graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
        PictureBox1.Image = screenshot
so yea thats my code for the screen shot full screen but i need it for range only so not full screen but my choice to choose like my desktop icons please help me if u have any idea what i m talking about :D if not i will try to explain more after i get a answer


thank you for reading
My current Projects Listed Below:
Toixt++ Text Editor Just 10 or less more features to go!
Image
Image
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Hello robby1998,


You could do something like this. You would need to add a new form and add the following controls to it:

1 Panel control
3 Button controls

Set the forms transparencykey to any color and set the panel controls background color to the same color.

Button1 captures the screen
Button2 saves the image captured
Button3 clears the current captured image

Then you just drag the form to the area you want to capture, you can click the edge of the form to resize it to the area you wish to capture then just press the capture button. You can download the source-files to this below. Try it out and let me know if its what you wanted.

Download:
CaptureScreen.zip
Happy coding cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Robby
VIP - Donator
VIP - Donator
Posts: 417
Joined: Mon Aug 03, 2009 4:01 am

thank you very much this helped me really much and now my new picture taker can be finished :)




Thx Code N Stuff!
My current Projects Listed Below:
Toixt++ Text Editor Just 10 or less more features to go!
Image
Image
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Hello,

Your welcome. If you need anymore help just let us know.

Good luck with your project.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Robby
VIP - Donator
VIP - Donator
Posts: 417
Joined: Mon Aug 03, 2009 4:01 am

ok i will let you know and thx again for the code i really appreciatte it : hehaho;
My current Projects Listed Below:
Toixt++ Text Editor Just 10 or less more features to go!
Image
Image
5 posts Page 1 of 1
Return to “Tutorial Requests”