By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,333 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,333 IT Pros & Developers. It's quick & easy.

Why BitBlt (screen capture) can't work on Win 98 & ME?

P: n/a
Hi,

Below source code I have try on Win 2k, XP & 2003 is work, but I try on
win 98 & ME the screen is capture black screen.

Dim dInt_dwRop As Integer = &HCC0020
Dim dImg As New
System.Drawing.Bitmap(Screen.PrimaryScreen.Bounds. Width,
Screen.PrimaryScreen.Bounds.Height,
System.Drawing.Imaging.PixelFormat.Format16bppRgb5 65)
Dim g As System.Drawing.Graphics =
System.Drawing.Graphics.FromImage(dImg)
Dim dc2 As IntPtr = g.GetHdc()
Dim hdcSrc As IntPtr =
User32.GetWindowDC(User32.GetDesktopWindow())

Gdi32.BitBlt(dc2, 0, 0, Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height, hdcSrc, 0, 0, dInt_dwRop)

g.ReleaseHdc(dc2)

thk,

Fong
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
* =?Utf-8?B?Zm9uZzAx?= <fo****@discussions.microsoft.com> scripsit:
Below source code I have try on Win 2k, XP & 2003 is work, but I try on
win 98 & ME the screen is capture black screen.

Dim dInt_dwRop As Integer = &HCC0020
Dim dImg As New
System.Drawing.Bitmap(Screen.PrimaryScreen.Bounds. Width,
Screen.PrimaryScreen.Bounds.Height,
System.Drawing.Imaging.PixelFormat.Format16bppRgb5 65)


What color depth is selected on the Windows 98/Me machine?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
* =?Utf-8?B?Zm9uZzAx?= <fo****@discussions.microsoft.com> scripsit:
what you mean "Color depth"?

- Color quality?


I am referring to the screen's color depth that is selected in the
system's display options.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

P: n/a
Hi Herfried K. Wagner,

System display color quality for win 98 & ME is 16 & 24 bits...
and screen resolution 1024 x 768
For the dwRop code is use &HCC0020
--------------------------------------------------------------------------------------
Gdi32.BitBlt(dc2, 0, 0, Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height, hdcSrc, 0, 0, dwRop)
--------------------------------------------------------------------------------------

thk,

Fong
Nov 20 '05 #4

P: n/a
* =?Utf-8?B?Zm9uZzAx?= <fo****@discussions.microsoft.com> scripsit:
System display color quality for win 98 & ME is 16 & 24 bits...
and screen resolution 1024 x 768


I am not sure, but I would look that the color quality of the
destination bitmap and the desktop match.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.