473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Screen capture

Hello,

I want to capture the entire screen as a bitmap (so I can stream it as an
http GET).
But I fail to capture it.
I tried some samples I found on the internet, but without success.
Any help would be appreciated
Nov 16 '05 #1
5 1838
See :-

http://www.codeproject.com/managedcpp/ijwscrcap.asp

--
Regards,
Nish [VC++ MVP]

"Mvmelle" <mv*****@yahoo.com> wrote in message
news:uN**************@TK2MSFTNGP12.phx.gbl...
Hello,

I want to capture the entire screen as a bitmap (so I can stream it as an
http GET).
But I fail to capture it.
I tried some samples I found on the internet, but without success.
Any help would be appreciated

Nov 16 '05 #2
Sorry, but I need an unmanaged sample.

"Nishant S" <ni**@nospam.asianetindia.com> wrote in message
news:ee**************@tk2msftngp13.phx.gbl...
See :-

http://www.codeproject.com/managedcpp/ijwscrcap.asp

--
Regards,
Nish [VC++ MVP]

"Mvmelle" <mv*****@yahoo.com> wrote in message
news:uN**************@TK2MSFTNGP12.phx.gbl...
Hello,

I want to capture the entire screen as a bitmap (so I can stream it as an http GET).
But I fail to capture it.
I tried some samples I found on the internet, but without success.
Any help would be appreciated


Nov 16 '05 #3
"Mvmelle" <mv*****@yahoo.com> wrote in message
news:uN**************@TK2MSFTNGP12.phx.gbl...
I want to capture the entire screen as a bitmap (so I can stream it as an
http GET).
This may help:

http://support.microsoft.com/?id=97193
But I fail to capture it.
I tried some samples I found on the internet, but without success.


Very nearly all of the WIN32 API's that can fail return an error code or set
the last error value in the calling thread. When you are having trouble it
is often a good idea to describe a little about the solutions you have tried
and how they have failed.

That said, though, the GDI group is probably better suited to your question
than this one.

Regards,
Will
Nov 16 '05 #4
"Mvmelle" <mv*****@yahoo.com> wrote in message
news:e0**************@TK2MSFTNGP12.phx.gbl...
This, got me going.
That's good.
Now sending a HBITMAP trough an open socket is another problem.


Handles are by and large process-specific and therefore machine-specific as
well. You don't want to send the handle to a bitmap. You want to send the
bitmap's bits with an appropriate content (MIME) type, most often image/bmp.
If you need to conserve bandwidth at the expense of image quality then
image/jpeg may be a better choice. Of course then you'll need a compressor
as well.

Regards,
Will

Nov 16 '05 #5
save the bmp into IStream, then you can get HGLOBAL from the IStream. The
following is a clue

void savebmp(CBitmap& bmp)
{
CPictureHolder picture;
picture.CreateFromBitmap((HBITMAP)bmp, NULL, TRUE);
LPPICTUREDISP pPictureDisp=picture.GetPictureDispatch();
pPictureDisp->Release(); // must be released
IStorage* pStg = 0;

hr = ::StgCreateDocfile(L"c:\\picttest",
STGM_SHARE_EXCLUSIVE |
STGM_CREATE |
STGM_READWRITE,
0, &pStg);
if(SUCCEEDED(hr))
{
IStream* pStream = 0;

hr = pStg->CreateStream(L"PICTURE",
STGM_SHARE_EXCLUSIVE |
STGM_CREATE |
STGM_READWRITE,
0, 0, &pStream);
if(SUCCEEDED(hr))
{
hr = pPictureDisp->SaveAsFile(pStream,
TRUE, // save mem copy
NULL);
pStream->Release();
}
pStg->Release();
}
pPictureDisp->Release();
}
"Mvmelle" <mv*****@yahoo.com> wrote in message
news:e0**************@TK2MSFTNGP12.phx.gbl...
This, got me going.
Now sending a HBITMAP trough an open socket is another problem.

"William DePalo [MVP VC++ ]" <wi***********@mvps.org> wrote in message
news:eH**************@TK2MSFTNGP11.phx.gbl...
"Mvmelle" <mv*****@yahoo.com> wrote in message
news:uN**************@TK2MSFTNGP12.phx.gbl...
I want to capture the entire screen as a bitmap (so I can stream it as an http GET).


This may help:

http://support.microsoft.com/?id=97193
But I fail to capture it.
I tried some samples I found on the internet, but without success.


Very nearly all of the WIN32 API's that can fail return an error code or

set
the last error value in the calling thread. When you are having trouble it is often a good idea to describe a little about the solutions you have

tried
and how they have failed.

That said, though, the GDI group is probably better suited to your

question
than this one.

Regards,
Will


Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
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...
1
by: xc | last post by:
Greetings. I encountered a wield problem when grabing screen images. Sometimes in some computers I can capture the screen, but other times not so. In some computer I cannot capture the screen...
3
by: Per | last post by:
Hi all, This may be a newbie question, but I can't find the answer anywhere. I want to make a capture of the screen, or a part of the screen, that contains the main portion of the form. Detecting...
1
by: Jody Gelowitz | last post by:
I have seen some examples of how to capture a color from a point on screen using C#, but haven't come across anything with VB.NET. Is this possible under VB.NET? I know that I will need to use...
2
by: Eddie Dunn | last post by:
I have one here that I cannot find anything on in my searching. I am implementing a screen capture functionality into my Visual Basic ..NET application. The code I am using calls the bitblt...
2
by: py | last post by:
I need to take a screen shot of the computer screen. I am trying to use PIL and I saw there is ImageGrab...however it only works on Windows. Is there a platform-independent ability to work...
4
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...
2
by: dumbledad | last post by:
Hi All, I'm using ASP.Net web services to provide the logic required for a Flash based prototype. The Flash and the ASP .Net run together on the client machine. One of the functions I'd like to...
4
by: Paolo Pantaleo | last post by:
Hi, I need to capture a screen snapshot in Linux. PIL has a module IageGrab, but in the free version it only works under Windows. Is there any package to capture the screen on Linux? Thnx...
5
Atran
by: Atran | last post by:
Hello Everyone. In this article: You will know to capture the screen in 2 ways: 1)- Capture full screen. 2)- Capture region. Let's Begin: First make a new Windows Application project. And...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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
0
BarryA
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...
1
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...
0
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...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.