You are viewing our Forum Archives. To view or take place in current topics click here.
[C#] Simple PC Screenshot Taker (With Source Code)
Posted:
[C#] Simple PC Screenshot Taker (With Source Code)Posted:
Status: Offline
Joined: Mar 26, 201113Year Member
Posts: 360
Reputation Power: 18
Status: Offline
Joined: Mar 26, 201113Year Member
Posts: 360
Reputation Power: 18
Download Link: [ Register or Signin to view external links. ]
Pictures:
[ Register or Signin to view external links. ]
Pictures:
[ Register or Signin to view external links. ]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
namespace ScreenshotCapturer
{
public partial class Form1 : Form
{
private static Bitmap bmpScreenshot;
private static Graphics gfxScreenshot;
public Form1()
{
InitializeComponent();
}
private void btnCapture_Click(object sender, EventArgs e)
{
// If the user has chosen a path where to save the screenshot
if (saveScreenshot.ShowDialog() == DialogResult.OK)
{
// Hide the form so that it does not appear in the screenshot
this.Hide();
//hides the form for 1000 miliseconds
System.Threading.Thread.Sleep(1000);
// Set the bitmap object to the size of the screen
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
// Create a graphics object from the bitmap
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
// Take the screenshot from the upper left corner to the right bottom corner
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
// Save the screenshot to the specified path that the user has chosen
bmpScreenshot.Save(saveScreenshot.FileName, ImageFormat.Png);
// Show the form again
this.Show();
}
}
}
}
#2. Posted:
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Nathanael wrote Download Link: [ Register or Signin to view external links. ]
Pictures:
[ Register or Signin to view external links. ]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
namespace ScreenshotCapturer
{
public partial class Form1 : Form
{
private static Bitmap bmpScreenshot;
private static Graphics gfxScreenshot;
public Form1()
{
InitializeComponent();
}
private void btnCapture_Click(object sender, EventArgs e)
{
// If the user has chosen a path where to save the screenshot
if (saveScreenshot.ShowDialog() == DialogResult.OK)
{
// Hide the form so that it does not appear in the screenshot
this.Hide();
//hides the form for 1000 miliseconds
System.Threading.Thread.Sleep(1000);
// Set the bitmap object to the size of the screen
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
// Create a graphics object from the bitmap
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
// Take the screenshot from the upper left corner to the right bottom corner
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
// Save the screenshot to the specified path that the user has chosen
bmpScreenshot.Save(saveScreenshot.FileName, ImageFormat.Png);
// Show the form again
this.Show();
}
}
}
}
What a coincidence I am making one as well. I was going to release it today, but the i had a little trouble with the jar file that I am still trying to work out.
I didn't see a mouse on yours. Did I miss it, or does it not display?
- 0useful
- 0not useful
#3. Posted:
Status: Offline
Joined: Jun 12, 201014Year Member
Posts: 531
Reputation Power: 33
99rock99 wroteNathanael wrote Download Link: [ Register or Signin to view external links. ]
Pictures:
[ Register or Signin to view external links. ]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
namespace ScreenshotCapturer
{
public partial class Form1 : Form
{
private static Bitmap bmpScreenshot;
private static Graphics gfxScreenshot;
public Form1()
{
InitializeComponent();
}
private void btnCapture_Click(object sender, EventArgs e)
{
// If the user has chosen a path where to save the screenshot
if (saveScreenshot.ShowDialog() == DialogResult.OK)
{
// Hide the form so that it does not appear in the screenshot
this.Hide();
//hides the form for 1000 miliseconds
System.Threading.Thread.Sleep(1000);
// Set the bitmap object to the size of the screen
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
// Create a graphics object from the bitmap
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
// Take the screenshot from the upper left corner to the right bottom corner
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
// Save the screenshot to the specified path that the user has chosen
bmpScreenshot.Save(saveScreenshot.FileName, ImageFormat.Png);
// Show the form again
this.Show();
}
}
}
}
What a coincidence I am making one as well. I was going to release it today, but the i had a little trouble with the jar file that I am still trying to work out.
I didn't see a mouse on yours. Did I miss it, or does it not display?
In .NET it doesn't capture the cursor.
- 0useful
- 0not useful
#4. Posted:
Status: Offline
Joined: Mar 26, 201113Year Member
Posts: 360
Reputation Power: 18
Status: Offline
Joined: Mar 26, 201113Year Member
Posts: 360
Reputation Power: 18
-CLK- wrote99rock99 wroteNathanael wrote Download Link: [ Register or Signin to view external links. ]
Pictures:
[ Register or Signin to view external links. ]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
namespace ScreenshotCapturer
{
public partial class Form1 : Form
{
private static Bitmap bmpScreenshot;
private static Graphics gfxScreenshot;
public Form1()
{
InitializeComponent();
}
private void btnCapture_Click(object sender, EventArgs e)
{
// If the user has chosen a path where to save the screenshot
if (saveScreenshot.ShowDialog() == DialogResult.OK)
{
// Hide the form so that it does not appear in the screenshot
this.Hide();
//hides the form for 1000 miliseconds
System.Threading.Thread.Sleep(1000);
// Set the bitmap object to the size of the screen
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
// Create a graphics object from the bitmap
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
// Take the screenshot from the upper left corner to the right bottom corner
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
// Save the screenshot to the specified path that the user has chosen
bmpScreenshot.Save(saveScreenshot.FileName, ImageFormat.Png);
// Show the form again
this.Show();
}
}
}
}
What a coincidence I am making one as well. I was going to release it today, but the i had a little trouble with the jar file that I am still trying to work out.
I didn't see a mouse on yours. Did I miss it, or does it not display?
In .NET it doesn't capture the cursor.
yup that is correct so do you guys like it?
- 0useful
- 0not useful
#5. Posted:
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Nathanael wrote-CLK- wrote99rock99 wroteNathanael wrote Download Link: [ Register or Signin to view external links. ]
Pictures:
[ Register or Signin to view external links. ]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
namespace ScreenshotCapturer
{
public partial class Form1 : Form
{
private static Bitmap bmpScreenshot;
private static Graphics gfxScreenshot;
public Form1()
{
InitializeComponent();
}
private void btnCapture_Click(object sender, EventArgs e)
{
// If the user has chosen a path where to save the screenshot
if (saveScreenshot.ShowDialog() == DialogResult.OK)
{
// Hide the form so that it does not appear in the screenshot
this.Hide();
//hides the form for 1000 miliseconds
System.Threading.Thread.Sleep(1000);
// Set the bitmap object to the size of the screen
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
// Create a graphics object from the bitmap
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
// Take the screenshot from the upper left corner to the right bottom corner
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
// Save the screenshot to the specified path that the user has chosen
bmpScreenshot.Save(saveScreenshot.FileName, ImageFormat.Png);
// Show the form again
this.Show();
}
}
}
}
What a coincidence I am making one as well. I was going to release it today, but the i had a little trouble with the jar file that I am still trying to work out.
I didn't see a mouse on yours. Did I miss it, or does it not display?
In .NET it doesn't capture the cursor.
yup that is correct so do you guys like it?
It is nice. I like the capture button. Java doesn't capture the cursor either. I have to draw it on manually, which is why mine has a select cursor option.
- 0useful
- 0not useful
#6. Posted:
Status: Offline
Joined: Mar 26, 201113Year Member
Posts: 360
Reputation Power: 18
Status: Offline
Joined: Mar 26, 201113Year Member
Posts: 360
Reputation Power: 18
99rock99 wroteNathanael wrote-CLK- wrote99rock99 wroteNathanael wrote Download Link: [ Register or Signin to view external links. ]
Pictures:
[ Register or Signin to view external links. ]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
namespace ScreenshotCapturer
{
public partial class Form1 : Form
{
private static Bitmap bmpScreenshot;
private static Graphics gfxScreenshot;
public Form1()
{
InitializeComponent();
}
private void btnCapture_Click(object sender, EventArgs e)
{
// If the user has chosen a path where to save the screenshot
if (saveScreenshot.ShowDialog() == DialogResult.OK)
{
// Hide the form so that it does not appear in the screenshot
this.Hide();
//hides the form for 1000 miliseconds
System.Threading.Thread.Sleep(1000);
// Set the bitmap object to the size of the screen
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
// Create a graphics object from the bitmap
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
// Take the screenshot from the upper left corner to the right bottom corner
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
// Save the screenshot to the specified path that the user has chosen
bmpScreenshot.Save(saveScreenshot.FileName, ImageFormat.Png);
// Show the form again
this.Show();
}
}
}
}
What a coincidence I am making one as well. I was going to release it today, but the i had a little trouble with the jar file that I am still trying to work out.
I didn't see a mouse on yours. Did I miss it, or does it not display?
In .NET it doesn't capture the cursor.
yup that is correct so do you guys like it?
It is nice. I like the capture button. Java doesn't capture the cursor either. I have to draw it on manually, which is why mine has a select cursor option.
that would be a good idea if i ever made an update for this thing, but i have only added and update button to one of my projects. the update button connects to my website, checks for the latest version, and if i have the latest version it tells me that, but if i need to update it downloads the files and then gives me the option to update or not. its really handy and i may make a tutorial on how to do that because i dont think i have seen many tutorials about that.
- 0useful
- 0not useful
#7. Posted:
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Nathanael wrote99rock99 wroteNathanael wrote-CLK- wrote99rock99 wroteNathanael wrote Download Link: [ Register or Signin to view external links. ]
Pictures:
[ Register or Signin to view external links. ]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
namespace ScreenshotCapturer
{
public partial class Form1 : Form
{
private static Bitmap bmpScreenshot;
private static Graphics gfxScreenshot;
public Form1()
{
InitializeComponent();
}
private void btnCapture_Click(object sender, EventArgs e)
{
// If the user has chosen a path where to save the screenshot
if (saveScreenshot.ShowDialog() == DialogResult.OK)
{
// Hide the form so that it does not appear in the screenshot
this.Hide();
//hides the form for 1000 miliseconds
System.Threading.Thread.Sleep(1000);
// Set the bitmap object to the size of the screen
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
// Create a graphics object from the bitmap
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
// Take the screenshot from the upper left corner to the right bottom corner
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
// Save the screenshot to the specified path that the user has chosen
bmpScreenshot.Save(saveScreenshot.FileName, ImageFormat.Png);
// Show the form again
this.Show();
}
}
}
}
What a coincidence I am making one as well. I was going to release it today, but the i had a little trouble with the jar file that I am still trying to work out.
I didn't see a mouse on yours. Did I miss it, or does it not display?
In .NET it doesn't capture the cursor.
yup that is correct so do you guys like it?
It is nice. I like the capture button. Java doesn't capture the cursor either. I have to draw it on manually, which is why mine has a select cursor option.
that would be a good idea if i ever made an update for this thing, but i have only added and update button to one of my projects. the update button connects to my website, checks for the latest version, and if i have the latest version it tells me that, but if i need to update it downloads the files and then gives me the option to update or not. its really handy and i may make a tutorial on how to do that because i dont think i have seen many tutorials about that.
That would be nice, too bad you can't make one for java... or can you?
- 0useful
- 0not useful
#8. Posted:
Status: Offline
Joined: Mar 26, 201113Year Member
Posts: 360
Reputation Power: 18
Status: Offline
Joined: Mar 26, 201113Year Member
Posts: 360
Reputation Power: 18
99rock99 wroteNathanael wrote99rock99 wroteNathanael wrote-CLK- wrote99rock99 wroteNathanael wrote Download Link: [ Register or Signin to view external links. ]
Pictures:
[ Register or Signin to view external links. ]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
namespace ScreenshotCapturer
{
public partial class Form1 : Form
{
private static Bitmap bmpScreenshot;
private static Graphics gfxScreenshot;
public Form1()
{
InitializeComponent();
}
private void btnCapture_Click(object sender, EventArgs e)
{
// If the user has chosen a path where to save the screenshot
if (saveScreenshot.ShowDialog() == DialogResult.OK)
{
// Hide the form so that it does not appear in the screenshot
this.Hide();
//hides the form for 1000 miliseconds
System.Threading.Thread.Sleep(1000);
// Set the bitmap object to the size of the screen
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
// Create a graphics object from the bitmap
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
// Take the screenshot from the upper left corner to the right bottom corner
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
// Save the screenshot to the specified path that the user has chosen
bmpScreenshot.Save(saveScreenshot.FileName, ImageFormat.Png);
// Show the form again
this.Show();
}
}
}
}
What a coincidence I am making one as well. I was going to release it today, but the i had a little trouble with the jar file that I am still trying to work out.
I didn't see a mouse on yours. Did I miss it, or does it not display?
In .NET it doesn't capture the cursor.
yup that is correct so do you guys like it?
It is nice. I like the capture button. Java doesn't capture the cursor either. I have to draw it on manually, which is why mine has a select cursor option.
that would be a good idea if i ever made an update for this thing, but i have only added and update button to one of my projects. the update button connects to my website, checks for the latest version, and if i have the latest version it tells me that, but if i need to update it downloads the files and then gives me the option to update or not. its really handy and i may make a tutorial on how to do that because i dont think i have seen many tutorials about that.
That would be nice, too bad you can't make one for java... or can you?
i never have really tried java much, at one point i wanted to develop for android but i got bored of it and quit (probably because i didnt know what i was doing)
- 0useful
- 0not useful
#9. Posted:
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Probably, but android development is a bit to difficult for me. I will stick to desktop apps fir now. Also does your updater work for java? I am trying to search for one now, but it would be nice to know.
- 0useful
- 0not useful
#10. Posted:
Status: Offline
Joined: Mar 26, 201113Year Member
Posts: 360
Reputation Power: 18
Status: Offline
Joined: Mar 26, 201113Year Member
Posts: 360
Reputation Power: 18
99rock99 wrote Probably, but android development is a bit to difficult for me. I will stick to desktop apps fir now. Also does your updater work for java? I am trying to search for one now, but it would be nice to know.
as of right now i dont think it works for java. i know the automatic updater works for C#, and VB. if you are using c++, or F#, ect then you have to use a standalone updater.
- 0useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.