shiner88
08-05-2009, 16:22
ho un problema...
in pratica sto cercando di ottenere uno screenshot dello shermo di un'applicazione in c# per windows mobile 6...
ho trovato un paio di istruzioni in giro...solo che c'è ne una che sotto winmo non esiste...e non riesco a trovare con cosa sostituirla...
ecco il codice
private void button1_Click(object sender, EventArgs e)
{
int screenWidth = Screen.PrimaryScreen.Bounds.Right;
int screenHeight = Screen.PrimaryScreen.Bounds.Bottom;
System.Threading.Thread.Sleep(5000);
Bitmap bmpScreenShot = new Bitmap(screenWidth, screenHeight);
Graphics gfx = Graphics.FromImage((Image)bmpScreenShot);
//gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
// gfx.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
bmpScreenShot.Save("test.jpg", ImageFormat.Jpeg);
il problema ce l'ho con l'istruzione commentata...in pratica non esiste CopyFromScreen nella classe Graphics..
qualcuno ha qualche soluzione????:muro:
in pratica sto cercando di ottenere uno screenshot dello shermo di un'applicazione in c# per windows mobile 6...
ho trovato un paio di istruzioni in giro...solo che c'è ne una che sotto winmo non esiste...e non riesco a trovare con cosa sostituirla...
ecco il codice
private void button1_Click(object sender, EventArgs e)
{
int screenWidth = Screen.PrimaryScreen.Bounds.Right;
int screenHeight = Screen.PrimaryScreen.Bounds.Bottom;
System.Threading.Thread.Sleep(5000);
Bitmap bmpScreenShot = new Bitmap(screenWidth, screenHeight);
Graphics gfx = Graphics.FromImage((Image)bmpScreenShot);
//gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
// gfx.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
bmpScreenShot.Save("test.jpg", ImageFormat.Jpeg);
il problema ce l'ho con l'istruzione commentata...in pratica non esiste CopyFromScreen nella classe Graphics..
qualcuno ha qualche soluzione????:muro: