|
How to capture a screen shot, and then save it as JPEG format?
Thanks in advance..
|
|
|
|
|
|
|
int screenWidth = Screen.GetBounds(new Point(0, 0)).Width;
int screenHeight = Screen.GetBounds(new Point(0, 0)).Height;
Bitmap screenShot = new Bitmap(screenWidth, screenHeight);
Graphics gfx = Graphics.FromImage((Image)screenShot);
gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
screenShot.Save(@"C:\YourScreenShot.jpg");
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
By the way, what are you trying to do?? I saw your posts here in the forum since February and it looks like you're trying to develop some sort of a Trojan/ hacking application.. Just hopping we're helping in that
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
thanks, it works.
but the size of image is still huge 1.5 Mb.
i would like to be as usual JPEG image, in Kbytes.
is there a way to do so.
|
|
|
|
|
i'm developing a client\server application, the application consist of two part
1- server control the clients log in to computers ( as internet cafe).
2- server monitor client (( what i hope for, is to do as Remote Administrator).
it's for college, and since i'am a new programmer, i have a lot of difficalties ..
thanks, any way .. please, excuse my bad english.
|
|
|
|
|
Hello,
Maybe you could try to use:
System.Drawing.Imaging.ImageFormat.Png Format instead of JPEG
It's amazing how good the quality is.
Hope it helps!
All the best,
Martin
|
|
|
|
|
Yes.. Sana'a university .. I've been there too!!
By the way, as Martin saied, try this:
screenShot.Save(@"C:\YourScreenShot.jpg", System.Drawing.Imaging.ImageFormat.Png);
Hussam Fattahi wrote: thanks, any way .. please, excuse my bad english.
It's ok, I'm Yemeni as well.
Good luck Hussam
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
A mini hacker's lounge within C# forum?
|
|
|
|
|
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello,
I’m having some difficulties using simple databinding on properties on a collection.
First of all, I’ve searched google for hours now, and I’ve tried numerous approaches. I’ll try to explain the problem as detailed as possible.
For simplicity I won’t be using any custom implementations here (even though I am in my application).
I have a collection named “Matrix” which consists of “Rows “(which again consist of Fields, but I’ll leave that out here).
<br />
public class Matrix : BindingList<Matrix.MatrixRow><br />
{<br />
private Guid matrixId;<br />
private string name;<br />
private string description;<br />
<br />
public Matrix(){}<br />
....<br />
<br />
public class MatrixRow : BindingList<MatrixRow.MatrixField><br />
{<br />
private Guid matrixRowId;<br />
private string name;<br />
private string description;<br />
<br />
public MatrixRow(){}<br />
....<br />
<br />
}<br />
}<br />
<br />
public string Name<br />
{<br />
get { return this.name; }<br />
set { this.name = value; }<br />
}<br />
<br />
public string Description<br />
{<br />
get { return this.description; }<br />
set { this.description = value; }<br />
}<br />
}<br />
The Matrix collection have properties such as “Name”, “Description”, etc which I would like bind to some textboxes.
this.wmTxtName.DataBindings.Add(new Binding("Text", this.matrix, "Name"));
This implementation produces the error: “Cannot bind to the property or column Test on the DataSource. Parameter name: dataMember”
As mentioned earlier I’m using a custom implementation of BindingList named SortableBindingList. SortableBindingList doesn’t do anything else than sorting the collection in different ways. Well, when I’m using SortableBindingList instead of BindingList I don’t get the error, it just won’t bind. That’s also freaking me out a bit, because I really don’t understand why it doesn’t produce the same error.
I also tried implementing ITypedList, but it’s not helping me perform simple databinding on the properties on the collection.
I would like to think that I’m not the only one who’s experiencing this problem, so if anyone have the same problems, or have a solution to this, please answer.
Best regards,
Jan-Erik Romøren
-- modified at 5:40 Wednesday 23rd May, 2007
|
|
|
|
|
Hi!
I'm working on a webservice project with around 10 types of XML files.
Each type is described by a XSD schema file.
Having such an XML file, I'd like to print it in a friendlier format(like HTML) so the user can make sense of it.
I know that this is done with XSLT, but for that I need XSL style sheets, which unfortunately I lack.
Is there any way to create an XSL style sheet starting from the XSD schema that describes the structure of the XML document?
What kind of XML software could prove helpful itself for this task?
Thank you.
|
|
|
|
|
Hi All,
How can i connect to a FTP server and down load the files from there in a C# application.
We are using .NET frame work 1.1 and cant use any third party components. I have tried using Webclient class. Its working fine when i use a http URL But generating the following exception while connecting to a FTP server.
System.NotSupportedException: The URI prefix is not recognized.
Any help is appreciated.
Thanks and Regards
Mahe
|
|
|
|
|
Googling FTP C#[^] returns alot of examples and none of them seem to be using the webclient class, perhaps a different approach is needed.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
The WebClient class doesn't work with FTP sites. .NET 1.1 does not have an FTP client built in. You'll either have to implement one yourself using sockets, or sue a third party component, or move up to Visual Studio .NET 2005 and .NET Framework 2.0. .NET 2.0 DOES have an FtpClient class built in.
|
|
|
|
|
Hello everyone,
I can use the following code to export Text from a selected cell in the DataGridView into a TextBox.
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)<br />
{<br />
textBox1.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["DayInfo"].Value.ToString();<br />
}
Can someone tell me how I can export an image and display it in a PictureBox?
Thank you very much for your help and have a great day.
khoramdin
|
|
|
|
|
hello to khoramdin
you can use this code for load a picture to a picturebox
from a datagridview cell:
in CellContentClick event you can type this code:
pictureBox1.Image =
Image.FromFile(dataGridView1.CurrentCell.Value.ToString());
Good Luck.
Editali (Alireza Loghmani)
|
|
|
|
|
hello to khoramdin
you can use this code for load a picture to a picturebox
from a datagridview cell:
in CellContentClick event you can type this code:
pictureBox1.Image =
Image.FromFile(dataGridView1.CurrentCell.Value.ToString());
Good Luck.
Editali (Alireza Loghmani)
|
|
|
|
|
Hi,
In our window based C#.net application, we are getting this "Window Handle Error" in a random manner. Initially we thought it could be a memory issue but sometimes even if there is enough memory, the same error comes. we are unable to track the root of this error. Any input regarding this error is most welcome.
Thanks,
Madhan
|
|
|
|
|
When the error occurs - what does the stack trace look like? What happens immediately prior to the error?
|
|
|
|
|
You may want to open Task Manager, go to the View menu and Select Columns. Turn on the Handles column.
Then run your application and start using it. If you application continues to accumulate handles and starts to climb over, say, 1,500 handles, you've got a handle leak problem. Your code isn't releasing unmanaged resources, like GDI handles, file handles, window handles, ... This means you're not calling .Dispose() on objects, like Graphics, Brush, Font, Pen, forms shown with ShowDialog(), ...
|
|
|
|
|
hi ,
How many Tables can a Data Set hold?
and how does Diffgram interact with data adapter.
pls help in understanding the basics.
bye
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
CodeVarma wrote: How many Tables can a Data Set hold?
I think Many
|
|
|
|
|
Up to available memory or int.MaxValue (2.1 Billion), which ever comes first.
|
|
|
|