I am developing a web based service tool using asp.net that we will distribute with
our product. This service tool will be used for remotely configuring the product, problem
determination, etc. One thing that I would like to be able to do is display a screen
capture of our product running. I have the code to get the screen capture of the
desktop and I also know how to send the image back to the client to be displayed.
The problem is that the code to grab the desktop image doesn't work when running
in my asp.net code on the server.
From what I have read on the subject, I suspect the problem is that the web server
is running under its own virtual desktop. If so can someone tell me if what I am
trying to do is even possible and if so how. The code I am using is as follows:
(I believe gr1.GetHdc() is where things start to fail).
System.Drawing.Image myImage = new Bitmap(1600, 1200);
Graphics gr1 = Graphics.FromImage(myImage);
IntPtr dc1 = gr1.GetHdc();
IntPtr dc2 = GetWindowDC(GetDesktopWindow());
BitBlt(dc1, 0, 0, 1600, 1200, dc2, 0, 0, 13369376);
Response.BufferOutput=true;
Response.Clear();
Response.ContentType="image/gif";
myImage.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif);
Response.End();
Thanks,
Terry 10 1231
I think that you can't get a printscreen on server because the server is
logged off.
You can try changing IIS service property. You can try to check Allow
Interact with desktop flag.
Brun
"Te*********@tech.com" <an*******@discussions.microsoft.com> wrote in
message news:07**********************************@microsof t.com... I am developing a web based service tool using asp.net that we will
distribute with our product. This service tool will be used for remotely configuring the
product, problem determination, etc. One thing that I would like to be able to do is
display a screen capture of our product running. I have the code to get the screen capture
of the desktop and I also know how to send the image back to the client to be
displayed. The problem is that the code to grab the desktop image doesn't work when
running in my asp.net code on the server.
From what I have read on the subject, I suspect the problem is that the
web server is running under its own virtual desktop. If so can someone tell me if
what I am trying to do is even possible and if so how. The code I am using is as
follows: (I believe gr1.GetHdc() is where things start to fail).
System.Drawing.Image myImage = new Bitmap(1600, 1200); Graphics gr1 = Graphics.FromImage(myImage); IntPtr dc1 = gr1.GetHdc(); IntPtr dc2 = GetWindowDC(GetDesktopWindow()); BitBlt(dc1, 0, 0, 1600, 1200, dc2, 0, 0, 13369376);
Response.BufferOutput=true; Response.Clear(); Response.ContentType="image/gif"; myImage.Save(Response.OutputStream,
System.Drawing.Imaging.ImageFormat.Gif); Response.End();
Thanks,
Terry
You will probably find more expert at this newsgroup
microsoft.public.dotnet.framework.drawing
I am not sure what you mean by "the server is logged off". In this case,
our product will be running on the server at the time I wish to do the screen
capture, so it will have been logged onto by someone.
I did try checking "Allow Interact with desktop flag" for the WWW Publishing
service but that didn't seem to help ... is there another service I should also
be checking that flag for?
Terry
----- Bruno Sirianni wrote: -----
I think that you can't get a printscreen on server because the server is
logged off.
You can try changing IIS service property. You can try to check Allow
Interact with desktop flag.
Brun
"Te*********@tech.com" <an*******@discussions.microsoft.com> wrote in
message news:07**********************************@microsof t.com... I am developing a web based service tool using asp.net that we will
distribute with our product. This service tool will be used for remotely configuring the
product, problem determination, etc. One thing that I would like to be able to do is
display a screen capture of our product running. I have the code to get the screen capture
of the desktop and I also know how to send the image back to the client to be
displayed. The problem is that the code to grab the desktop image doesn't work when
running in my asp.net code on the server. From what I have read on the subject, I suspect the problem is that the
web server is running under its own virtual desktop. If so can someone tell me if
what I am trying to do is even possible and if so how. The code I am using is as
follows: (I believe gr1.GetHdc() is where things start to fail). System.Drawing.Image myImage = new Bitmap(1600, 1200); Graphics gr1 = Graphics.FromImage(myImage); IntPtr dc1 = gr1.GetHdc(); IntPtr dc2 = GetWindowDC(GetDesktopWindow()); BitBlt(dc1, 0, 0, 1600, 1200, dc2, 0, 0, 13369376); Response.BufferOutput=true; Response.Clear(); Response.ContentType="image/gif"; myImage.Save(Response.OutputStream,
System.Drawing.Imaging.ImageFormat.Gif); Response.End(); Thanks, Terry
I think that you can't get a printscreen on server because the server is
logged off.
You can try changing IIS service property. You can try to check Allow
Interact with desktop flag.
Brun
"Te*********@tech.com" <an*******@discussions.microsoft.com> wrote in
message news:07**********************************@microsof t.com... I am developing a web based service tool using asp.net that we will
distribute with our product. This service tool will be used for remotely configuring the
product, problem determination, etc. One thing that I would like to be able to do is
display a screen capture of our product running. I have the code to get the screen capture
of the desktop and I also know how to send the image back to the client to be
displayed. The problem is that the code to grab the desktop image doesn't work when
running in my asp.net code on the server.
From what I have read on the subject, I suspect the problem is that the
web server is running under its own virtual desktop. If so can someone tell me if
what I am trying to do is even possible and if so how. The code I am using is as
follows: (I believe gr1.GetHdc() is where things start to fail).
System.Drawing.Image myImage = new Bitmap(1600, 1200); Graphics gr1 = Graphics.FromImage(myImage); IntPtr dc1 = gr1.GetHdc(); IntPtr dc2 = GetWindowDC(GetDesktopWindow()); BitBlt(dc1, 0, 0, 1600, 1200, dc2, 0, 0, 13369376);
Response.BufferOutput=true; Response.Clear(); Response.ContentType="image/gif"; myImage.Save(Response.OutputStream,
System.Drawing.Imaging.ImageFormat.Gif); Response.End();
Thanks,
Terry
You will probably find more expert at this newsgroup
microsoft.public.dotnet.framework.drawing
I am not sure what you mean by "the server is logged off". In this case,
our product will be running on the server at the time I wish to do the screen
capture, so it will have been logged onto by someone.
I did try checking "Allow Interact with desktop flag" for the WWW Publishing
service but that didn't seem to help ... is there another service I should also
be checking that flag for?
Terry
----- Bruno Sirianni wrote: -----
I think that you can't get a printscreen on server because the server is
logged off.
You can try changing IIS service property. You can try to check Allow
Interact with desktop flag.
Brun
"Te*********@tech.com" <an*******@discussions.microsoft.com> wrote in
message news:07**********************************@microsof t.com... I am developing a web based service tool using asp.net that we will
distribute with our product. This service tool will be used for remotely configuring the
product, problem determination, etc. One thing that I would like to be able to do is
display a screen capture of our product running. I have the code to get the screen capture
of the desktop and I also know how to send the image back to the client to be
displayed. The problem is that the code to grab the desktop image doesn't work when
running in my asp.net code on the server. From what I have read on the subject, I suspect the problem is that the
web server is running under its own virtual desktop. If so can someone tell me if
what I am trying to do is even possible and if so how. The code I am using is as
follows: (I believe gr1.GetHdc() is where things start to fail). System.Drawing.Image myImage = new Bitmap(1600, 1200); Graphics gr1 = Graphics.FromImage(myImage); IntPtr dc1 = gr1.GetHdc(); IntPtr dc2 = GetWindowDC(GetDesktopWindow()); BitBlt(dc1, 0, 0, 1600, 1200, dc2, 0, 0, 13369376); Response.BufferOutput=true; Response.Clear(); Response.ContentType="image/gif"; myImage.Save(Response.OutputStream,
System.Drawing.Imaging.ImageFormat.Gif); Response.End(); Thanks, Terry
I have tryed yuor code and read MSDN documentation.
gr1.GetHdc() return the device context for a Windows GDI-based structure.
ASP.NET is not in a windows form!!
You can try making a simple form application that do this.
You can run this exe and then get the image...
Brun
"Te*********@tech.com" <an*******@discussions.microsoft.com> wrote in
message news:CE**********************************@microsof t.com... I am not sure what you mean by "the server is logged off". In this case, our product will be running on the server at the time I wish to do the
screen capture, so it will have been logged onto by someone.
I did try checking "Allow Interact with desktop flag" for the WWW
Publishing service but that didn't seem to help ... is there another service I should
also be checking that flag for?
Terry
----- Bruno Sirianni wrote: -----
I think that you can't get a printscreen on server because the server
is logged off. You can try changing IIS service property. You can try to check Allow Interact with desktop flag.
Brun
"Te*********@tech.com" <an*******@discussions.microsoft.com> wrote in message news:07**********************************@microsof t.com... > I am developing a web based service tool using asp.net that we will distribute with > our product. This service tool will be used for remotely
configuring the product, problem > determination, etc. One thing that I would like to be able to do
is display a screen > capture of our product running. I have the code to get the screen
capture of the > desktop and I also know how to send the image back to the client to
be displayed. > The problem is that the code to grab the desktop image doesn't work
when running > in my asp.net code on the server. >> From what I have read on the subject, I suspect the problem is
that the web server > is running under its own virtual desktop. If so can someone tell
me if what I am > trying to do is even possible and if so how. The code I am using
is as follows: > (I believe gr1.GetHdc() is where things start to fail). >> System.Drawing.Image myImage = new Bitmap(1600, 1200); > Graphics gr1 = Graphics.FromImage(myImage); > IntPtr dc1 = gr1.GetHdc(); > IntPtr dc2 = GetWindowDC(GetDesktopWindow()); > BitBlt(dc1, 0, 0, 1600, 1200, dc2, 0, 0, 13369376); >> Response.BufferOutput=true; > Response.Clear(); > Response.ContentType="image/gif"; > myImage.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif); > Response.End(); >> Thanks, >> Terry >
I have tryed yuor code and read MSDN documentation.
gr1.GetHdc() return the device context for a Windows GDI-based structure.
ASP.NET is not in a windows form!!
You can try making a simple form application that do this.
You can run this exe and then get the image...
Brun
"Te*********@tech.com" <an*******@discussions.microsoft.com> wrote in
message news:CE**********************************@microsof t.com... I am not sure what you mean by "the server is logged off". In this case, our product will be running on the server at the time I wish to do the
screen capture, so it will have been logged onto by someone.
I did try checking "Allow Interact with desktop flag" for the WWW
Publishing service but that didn't seem to help ... is there another service I should
also be checking that flag for?
Terry
----- Bruno Sirianni wrote: -----
I think that you can't get a printscreen on server because the server
is logged off. You can try changing IIS service property. You can try to check Allow Interact with desktop flag.
Brun
"Te*********@tech.com" <an*******@discussions.microsoft.com> wrote in message news:07**********************************@microsof t.com... > I am developing a web based service tool using asp.net that we will distribute with > our product. This service tool will be used for remotely
configuring the product, problem > determination, etc. One thing that I would like to be able to do
is display a screen > capture of our product running. I have the code to get the screen
capture of the > desktop and I also know how to send the image back to the client to
be displayed. > The problem is that the code to grab the desktop image doesn't work
when running > in my asp.net code on the server. >> From what I have read on the subject, I suspect the problem is
that the web server > is running under its own virtual desktop. If so can someone tell
me if what I am > trying to do is even possible and if so how. The code I am using
is as follows: > (I believe gr1.GetHdc() is where things start to fail). >> System.Drawing.Image myImage = new Bitmap(1600, 1200); > Graphics gr1 = Graphics.FromImage(myImage); > IntPtr dc1 = gr1.GetHdc(); > IntPtr dc2 = GetWindowDC(GetDesktopWindow()); > BitBlt(dc1, 0, 0, 1600, 1200, dc2, 0, 0, 13369376); >> Response.BufferOutput=true; > Response.Clear(); > Response.ContentType="image/gif"; > myImage.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif); > Response.End(); >> Thanks, >> Terry >
I have a service (look like IIS) that can execute applicacation.
1 of this application is used for make graphics (Pie, etc...). The component
I use for render this must have the desktop because if not graph is blank!
I have set interact with desktop property of my service and there is not
problem!
When Application run I can see this!!!!
Brun!
"TerryWilson" <an*******@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com... OK, I tried spawning a simple application that simply grabs the desktop and writes the image out to a file. If I run the application
directly, it works as expected, however, when I spawn it from my aspx page on the server I simply get a blank image written out to the file.
I still think the key (as I read in another post in this group) is that
the web server is running as a service in some virtual desktop that is
different from the visible desktop. So how do you get the window handle to the currently visible desktop???
Terry ----- Bruno Sirianni wrote: -----
I have tryed yuor code and read MSDN documentation.
gr1.GetHdc() return the device context for a Windows GDI-based
structure. ASP.NET is not in a windows form!!
You can try making a simple form application that do this. You can run this exe and then get the image...
Brun
"Te*********@tech.com" <an*******@discussions.microsoft.com> wrote in message news:CE**********************************@microsof t.com... > I am not sure what you mean by "the server is logged off". In this
case, > our product will be running on the server at the time I wish to do
the screen > capture, so it will have been logged onto by someone. >> I did try checking "Allow Interact with desktop flag" for the WWW Publishing > service but that didn't seem to help ... is there another service I
should also > be checking that flag for? >> Terry >> ----- Bruno Sirianni wrote: ----- >> I think that you can't get a printscreen on server because
the server is > logged off. > You can try changing IIS service property. You can try to
check Allow > Interact with desktop flag. >> Brun >> "Te*********@tech.com" <an*******@discussions.microsoft.com>
wrote in > message
news:07**********************************@microsof t.com... >> I am developing a web based service tool using asp.net that we
will > distribute with >> our product. This service tool will be used for remotely configuring the > product, problem >> determination, etc. One thing that I would like to be able to do is > display a screen >> capture of our product running. I have the code to get the screen capture > of the >> desktop and I also know how to send the image back to the client
to be > displayed. >> The problem is that the code to grab the desktop image doesn't
work when > running >> in my asp.net code on the server. >>> From what I have read on the subject, I suspect the problem is that the > web server >> is running under its own virtual desktop. If so can someone tell me if > what I am >> trying to do is even possible and if so how. The code I am using is as > follows: >> (I believe gr1.GetHdc() is where things start to fail). >>> System.Drawing.Image myImage = new Bitmap(1600, 1200); >> Graphics gr1 = Graphics.FromImage(myImage); >> IntPtr dc1 = gr1.GetHdc(); >> IntPtr dc2 = GetWindowDC(GetDesktopWindow()); >> BitBlt(dc1, 0, 0, 1600, 1200, dc2, 0, 0, 13369376); >>> Response.BufferOutput=true; >> Response.Clear(); >> Response.ContentType="image/gif"; >> myImage.Save(Response.OutputStream, > System.Drawing.Imaging.ImageFormat.Gif); >> Response.End(); >>> Thanks, >>> Terry >>
I have a service (look like IIS) that can execute applicacation.
1 of this application is used for make graphics (Pie, etc...). The component
I use for render this must have the desktop because if not graph is blank!
I have set interact with desktop property of my service and there is not
problem!
When Application run I can see this!!!!
Brun!
"TerryWilson" <an*******@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com... OK, I tried spawning a simple application that simply grabs the desktop and writes the image out to a file. If I run the application
directly, it works as expected, however, when I spawn it from my aspx page on the server I simply get a blank image written out to the file.
I still think the key (as I read in another post in this group) is that
the web server is running as a service in some virtual desktop that is
different from the visible desktop. So how do you get the window handle to the currently visible desktop???
Terry ----- Bruno Sirianni wrote: -----
I have tryed yuor code and read MSDN documentation.
gr1.GetHdc() return the device context for a Windows GDI-based
structure. ASP.NET is not in a windows form!!
You can try making a simple form application that do this. You can run this exe and then get the image...
Brun
"Te*********@tech.com" <an*******@discussions.microsoft.com> wrote in message news:CE**********************************@microsof t.com... > I am not sure what you mean by "the server is logged off". In this
case, > our product will be running on the server at the time I wish to do
the screen > capture, so it will have been logged onto by someone. >> I did try checking "Allow Interact with desktop flag" for the WWW Publishing > service but that didn't seem to help ... is there another service I
should also > be checking that flag for? >> Terry >> ----- Bruno Sirianni wrote: ----- >> I think that you can't get a printscreen on server because
the server is > logged off. > You can try changing IIS service property. You can try to
check Allow > Interact with desktop flag. >> Brun >> "Te*********@tech.com" <an*******@discussions.microsoft.com>
wrote in > message
news:07**********************************@microsof t.com... >> I am developing a web based service tool using asp.net that we
will > distribute with >> our product. This service tool will be used for remotely configuring the > product, problem >> determination, etc. One thing that I would like to be able to do is > display a screen >> capture of our product running. I have the code to get the screen capture > of the >> desktop and I also know how to send the image back to the client
to be > displayed. >> The problem is that the code to grab the desktop image doesn't
work when > running >> in my asp.net code on the server. >>> From what I have read on the subject, I suspect the problem is that the > web server >> is running under its own virtual desktop. If so can someone tell me if > what I am >> trying to do is even possible and if so how. The code I am using is as > follows: >> (I believe gr1.GetHdc() is where things start to fail). >>> System.Drawing.Image myImage = new Bitmap(1600, 1200); >> Graphics gr1 = Graphics.FromImage(myImage); >> IntPtr dc1 = gr1.GetHdc(); >> IntPtr dc2 = GetWindowDC(GetDesktopWindow()); >> BitBlt(dc1, 0, 0, 1600, 1200, dc2, 0, 0, 13369376); >>> Response.BufferOutput=true; >> Response.Clear(); >> Response.ContentType="image/gif"; >> myImage.Save(Response.OutputStream, > System.Drawing.Imaging.ImageFormat.Gif); >> Response.End(); >>> Thanks, >>> Terry >> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Me Mine |
last post by:
i,
I have trying to code a small console app that will
allow a user to select a window and then create a
screen capture of the window. I haven't been able to
figure out how to do the screen...
|
by: Madestro |
last post by:
Hi guys,
I have a little problem. I have a class that uses Windows API to capture a
snapshot of the screen. I have this class in a library that I include in my
projects.
When I try to use...
|
by: hellokitty |
last post by:
GetDC/GetWindowDC can only capture on screen,visually, stuff and not
for screen in background
If I execute an exe in other desktop, by CreateDesktop/SwitchDesktop, it
requires to actually...
|
by: TerryWilson |
last post by:
I am developing a web based service tool using asp.net that we will distribute with
our product. This service tool will be used for remotely configuring the product, problem
determination, etc. ...
|
by: Marcob |
last post by:
Is there any component out there to capture screen text from a specific
region on any active external application form.
Thanks
Marco
|
by: Juan Romero |
last post by:
Guys,
I am trying to capture the desktop screen (everything).
I am having a problem with the "CreateCompatibleBitmap" API call. For some
reason the function is creating a 1x1 pixels bitmap...
|
by: gwhite1 |
last post by:
I use this code to capture a screen in a regular VB 2005 windows app.
It works great! I found the code in google. But when I create a windows
service it does not capture the screen. It only...
|
by: Rune Strand |
last post by:
Is it possible by use of pyWin32 or ctypes to make a screen capture of
an inactive, or a hidden window if the hwnd/WindowName/ClassName is
known? I've seen dedicated screen capture software do...
|
by: JP2006 |
last post by:
I'm trying to write a control that will take a screen capture of a
particular website when a user submits a form in a web application; one
of the form fields is for a URL - the control needs to get...
|
by: hemant |
last post by:
I am trying to Caputre the screen in windows service with the GDI Api
of Win32 in vb.net
1. CreateDc
2. CreateCompatibleDC
3. CreateCompatibleBitmapDc
4. Bitblt
5. SelectObject
6. ...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |