473,397 Members | 1,950 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,397 software developers and data experts.

obtain win desktop picture

Hello,

How do i get Windows Desktop picture to further put it into pictureBox
component?

Thank you,
Andrey
Nov 15 '05 #1
5 1700
The path used for the current wallpaper is stored in the registry, I don't
remember the exact key, you'll have to search for it.

So, read this key and then assign it to the pictureBox.Image property...
"MuZZy" <le*******@yahoo.com> wrote in message
news:tpu_b.110880$uV3.598285@attbi_s51...
Hello,

How do i get Windows Desktop picture to further put it into pictureBox
component?

Thank you,
Andrey

Nov 15 '05 #2
Well, I didn't men wallpaper, i meant everything you see on the screen.

On Delphi i've done it this way:

Class Procedure TMuzzyServer.getScreen( ABitmap : TBitmap );
Var
dc : Integer;
srect : TRect;
scanvas : TCanvas;
Begin
// get desktop HDC
dc := GetWindowDC(0);
// Create a rectangle with screen size
srect := Rect(0, 0, Screen.Width, Screen.Height);
// Create a canvas for desktop HDC
scanvas := TCanvas.Create();
scanvas.Handle := dc;
ABitmap.Height := srect.Bottom;
ABitmap.Width := srect.Right;
ABitmap.Canvas.CopyRect(srect, scanvas, srect);
ReleaseDC(0, dc);
scanvas.Free;
End;

/////

So i obtained HDC of desktop window which has HANDLE = 0, and then played
around.

How do i do in .NET?

Thank you,
Andrey

"Craig" <cs******@remoovdis.kc.rr.com> wrote in message
news:uN****************@TK2MSFTNGP10.phx.gbl...
The path used for the current wallpaper is stored in the registry, I don't
remember the exact key, you'll have to search for it.

So, read this key and then assign it to the pictureBox.Image property...
"MuZZy" <le*******@yahoo.com> wrote in message
news:tpu_b.110880$uV3.598285@attbi_s51...
Hello,

How do i get Windows Desktop picture to further put it into pictureBox
component?

Thank you,
Andrey


Nov 15 '05 #3

"MuZZy" <le*******@yahoo.com> wrote in message
news:97v_b.111251$uV3.598257@attbi_s51...
Well, I didn't men wallpaper, i meant everything you see on the screen.

On Delphi i've done it this way:

Class Procedure TMuzzyServer.getScreen( ABitmap : TBitmap );
Var
dc : Integer;
srect : TRect;
scanvas : TCanvas;
Begin
// get desktop HDC
dc := GetWindowDC(0);
// Create a rectangle with screen size
srect := Rect(0, 0, Screen.Width, Screen.Height);
// Create a canvas for desktop HDC
scanvas := TCanvas.Create();
scanvas.Handle := dc;
ABitmap.Height := srect.Bottom;
ABitmap.Width := srect.Right;
ABitmap.Canvas.CopyRect(srect, scanvas, srect);
ReleaseDC(0, dc);
scanvas.Free;
End;

/////

So i obtained HDC of desktop window which has HANDLE = 0, and then played
around.

How do i do in .NET?

Thank you,
Andrey

"Craig" <cs******@remoovdis.kc.rr.com> wrote in message
news:uN****************@TK2MSFTNGP10.phx.gbl...
The path used for the current wallpaper is stored in the registry, I don't remember the exact key, you'll have to search for it.

So, read this key and then assign it to the pictureBox.Image property...
"MuZZy" <le*******@yahoo.com> wrote in message
news:tpu_b.110880$uV3.598285@attbi_s51...
Hello,

How do i get Windows Desktop picture to further put it into pictureBox
component?

Thank you,
Andrey


Basicly what i want to do is to capture screen images in certain intervals
of time or on certain event, and put it in a database. So i need a screen
image, same as if i pressed [PrintScreen] button.
Nov 15 '05 #4
MuZZy wrote:
Hello,

How do i get Windows Desktop picture to further put it into pictureBox
component?

Thank you,
Andrey


Hi -

Check out "Screen Capture using C# and GDI+" here:

http://www.c-sharpcorner.com/Code/20...eenCapture.asp

Good luck.

--
chris
Nov 15 '05 #5
"chris" <ne********@boxfrog.com> wrote in message
news:pe********************@comcast.com...
MuZZy wrote:
Hello,

How do i get Windows Desktop picture to further put it into pictureBox
component?

Thank you,
Andrey


Hi -

Check out "Screen Capture using C# and GDI+" here:

http://www.c-sharpcorner.com/Code/20...eenCapture.asp

Good luck.

--
chris

Thanks a lot, Chris!
Nov 15 '05 #6

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

Similar topics

383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
1
by: HB2 | last post by:
Is it possible to obtain the IP address of my desktop using a Visual Basic command?
2
by: Selden McCabe | last post by:
I have a desktop application which communicates with a web server, using a web service. Mostly, the web service reads and writes data to Access databases on the web server. Now, I need to...
5
by: GH | last post by:
Is it possible to display images on the desktop itself, like the bacground but not as a background? And not as icons either. Anything you put in the \Desktop folder shows up as an icon on the...
1
by: VictorG | last post by:
Hello, The below C# code works fine in obtaining the windows user's account SID when the user is local to the machine. It throws a "Not Found" exception when trying top obtain the SID for a...
0
Atran
by: Atran | last post by:
Hello Every Body. Anyone know how to Capture The Computer Screen Picture, I mean The desktop, Capture the picture of the Desktop.
66
ak1dnar
by: ak1dnar | last post by:
Hi there, As you can see in the attached picture there is a blue color background on the name of the desktop shortcuts. How to remove this. (Should I say Plzzzzz ?) Thanks -ajaxrand
2
jamesd0142
by: jamesd0142 | last post by:
Hi jus looking for some ideas if possible: I trying to create a basic remote desktop application (WHY?...to see if i can.). I have an idea how i can control the mouse on the remote machine but...
4
jamesd0142
by: jamesd0142 | last post by:
Hi jus looking for some ideas if possible: I trying to create a basic remote desktop application (WHY?...to see if i can.). I have an idea how i can control the mouse on the remote machine but...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.