Jump to content

SUBIECTE NOI
« 1 / 5 »
RSS
Poveste fara sfarșit

I-auziti voi! - nu vor romani...

Colon iritabil

Perioada de gratie inexistenta
 Cel mai ieftin TV LED mic

Reverse proxy si htaccess pe Raps...

Statie de epurare sau fosa septic...

"enerlux p" afisaj interm...
 Adaptor usb3.1gigabit vs Adaptor ...

La multi ani @Atreides!

La multi ani @KENSINGTON!

La multi ani @burebista!
 La multi ani de Florii!

Stihl fs 70 c-e

Challengers (2024)

Care mai sunt mediile de admitere...
 

Programe de captura ecran

- - - - -
  • Please log in to reply
No replies to this topic

#1
timisoreanul2005

timisoreanul2005

    Junior Member

  • Grup: Members
  • Posts: 156
  • Înscris: 27.09.2006
a fost nu demult un utilizator interesat de capturarea de imagini de pe un computer remote,
cred ca se poate realiza un  program rezident in memorie care constant cauta instanta unei ferestre
pe care sa o captureze in momentul cind devine activa, de exemplu un utilizator deschide fereastra de Word
programul Screen Capture va creea un log cu imaginea respectiva si salva intr-un fisier pe retea, ori local si apoi transmite la un server pe retea upload. cosul sursa pentru un program de captura GDI scris in C Sharp gasiti aici : http://www.c-sharpco...tureUtility.asp, transferul imaginii prin portul 80 via Http cred ca se poate realiza deasemenea sint coduri sursa disponibile. Happy Coding Guys

Codul Sursa :

private void PerformCapture()
{
// turn the form invisible so you don't show it during capture
this.Visible = false;

//use the GDI call and create a DC to the whole display

IntPtr dc1 = CreateDC("DISPLAY", null, null, (IntPtr)null);

//create a Graphics object for the screen dc

Graphics g1 = Graphics.FromHdc(dc1);

//  create a compatible bitmap the size of the entire screen

MyImage = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, g1);

//  use the bitmap to create another Graphics surface  so we can  BitBlast into the bitmap

Graphics g2 = Graphics.FromImage(MyImage);

//  Now go retrace our steps and get the device contexts for both the bitmap and the screen
// Note:  Apparently you have to do this, and can't go directly from the aquired dc or exceptions are thrown
//            When you try to release the dcs

dc1 = g1.GetHdc();

IntPtr dc2 = g2.GetHdc();

//  Bit Blast  the screen into the Bitmap

BitBlt(dc2, 0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, dc1, 0, 0, 13369376);

//   Remember to release the dc's, otherwise problems down the road

g1.ReleaseHdc(dc1);

g2.ReleaseHdc(dc2);

// Save the image to JPEG file

MyImage.Save(@"c:\Captured.jpg", ImageFormat.Jpeg);

//  Now we can view our form again, so make it visible

Visible = true;

MessageBox.Show("Finished Saving Image");

// Set the Bounds of the form so that it fills the entire screen
// Because in our Paint event handler we are going to draw the bitmap to the form

this.SetBounds(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

//  ************** Set up functions for doing additional bitmap manipulation such as cropping a portion of
//  ************* the image ****************(Not required for screen capture)

SetupCropping();

firstCrop = true;

}

Anunturi

Bun venit pe Forumul Softpedia!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Forumul Softpedia foloseste "cookies" pentru a imbunatati experienta utilizatorilor Accept
Pentru detalii si optiuni legate de cookies si datele personale, consultati Politica de utilizare cookies si Politica de confidentialitate