Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Graphics
  4. Screen Capture over Terminal Server

Screen Capture over Terminal Server

Scheduled Pinned Locked Moved Graphics
graphicswinformscomsysadminhelp
1 Posts 1 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    intonet
    wrote on last edited by
    #1

    I'm experiencing a wierd problem when capturing a screen from within a desktop app running on terminal server. Here's my code: Public Shared Function CaptureControlImage(ByVal pControl As Control, Optional ByVal pstrFilename As String = "") As System.Drawing.Image ' Returns the image contained with the referenced controls client rectangle and optionally saves it to JPEG file Dim g As Graphics Dim picture As PictureBox Dim img As Image ' Create a new PictureBox control. This is used to manipulate the captured bitmap picture = New PictureBox picture.Image = New Bitmap(pControl.ClientRectangle.Width, pControl.ClientRectangle.Height) ' Create a GDI+ drawing surface based on the PictureBox control g = Graphics.FromImage(picture.Image) ' BitBlt the screen image at the co-ordinates representing the referenced controls client rectangle ' into the drawing surface, which is the PictureBox control g.CopyFromScreen(pControl.PointToScreen(New Point(pControl.ClientRectangle.X, pControl.ClientRectangle.Y)), _ New Point(0, 0), _ New Size(pControl.ClientRectangle.Width, pControl.ClientRectangle.Height)) ' Creates an image object from the PictureBox surface img = picture.Image If Not IsNothing(img) AndAlso pstrFilename <> String.Empty Then ' Save the image to disk if required img.Save(pstrFilename, Drawing.Imaging.ImageFormat.Jpeg) End If Return img End Function It works just fine when running locally, but when the app is deployed on another server and it's access via terminal server, then this is what you get: http://www.threefivefive.com/gallery/data/500/medium/capture_ts.jpg[^] Can anyone tell me why?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups