473,387 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

take a screenshot and crop image

i want to take a screenshot of user's desktop, just like printscreen does and crop it, because i just want the system tray of taskbar is it possible? (system tray == notification area)
Jul 31 '09 #1
2 4890
GaryTexmo
1,501 Expert 1GB
Vishal, have a look at the discussion in this thread. This person is having trouble taking screenshots of a DirectX application, but their first post shows code that should take a screenshot of the desktop.

As for cropping, a google search turned out this lovely little block of code for you.
Expand|Select|Wrap|Line Numbers
  1. public Bitmap CropBitmap(Bitmap bitmap, int cropX, int cropY, int cropWidth, int cropHeight)
  2. {
  3.   Rectangle rect = new Rectangle(cropX, cropY, cropWidth, cropHeight);
  4.   Bitmap cropped = bitmap.Clone(rect, bitmap.PixelFormat);
  5.   return cropped;
  6. }
http://www.nerdydork.com/crop-an-ima...-or-vbnet.html
Jul 31 '09 #2
thanks again :D works!
Jul 31 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Kevin Smith | last post by:
Is there a way to "auto-crop" an image in PIL? I have some PNG images with white backgrounds that I want cropped to show only the non-white portion in the center, but I don't see how I can do...
2
by: Mike Mimic | last post by:
Hi! I would like to know if there is some kind of program which would make a screenshot of a web page without use of X Windows. I have a server without X Windows and I would like to have a...
2
by: sandman | last post by:
Is this a one-time deal? Or something you want to do programmatically? If it's a one-time thing (e.g. to create a bitmap that you can then use in your program), just press Print-Screen, then load...
3
by: ACaunter | last post by:
Hi there, I was wondering if there was a way to crop a peice of an ASP.Net Image, allowing the user to zoom in on only a section of the picture?? any help would be appreciated!! thanks --...
6
by: John Salerno | last post by:
I might be way off target even looking into this method for what I need to do, but I'm still a little confused about the description of it: crop im.crop(box) => image Returns a rectangular...
1
by: liuliuliu | last post by:
hi -- sorry if this is trivial -- but how do you make a screenshot of a pygame display? i have a surface which is basically the entire visible screen -- how do you write this surface as an image...
1
by: arunbalait | last post by:
I want to crop an image in VB and to store the cropped image in another image box or any... I want source code samples
2
by: sampath nslabs | last post by:
sir How to crop the image in visual basic 6.0.iam geting in vb.net but i want purelly in vb.plese give the code for that or give me useful snippts.i expecting source code for crop the image .pls...
3
by: fuchsia555 | last post by:
hi is there a code to crop bottom border from an image when creating thumbnail for this image without crop the original image , but just crop 15px bottom border for creating the thumbnails for the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.