473,770 Members | 5,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1721
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.Imag e property...
"MuZZy" <le*******@yaho o.com> wrote in message
news:tpu_b.1108 80$uV3.598285@a ttbi_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.ge tScreen( 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******@remoo vdis.kc.rr.com> wrote in message
news:uN******** ********@TK2MSF TNGP10.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.Imag e property...
"MuZZy" <le*******@yaho o.com> wrote in message
news:tpu_b.1108 80$uV3.598285@a ttbi_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*******@yaho o.com> wrote in message
news:97v_b.1112 51$uV3.598257@a ttbi_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.ge tScreen( 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******@remoo vdis.kc.rr.com> wrote in message
news:uN******** ********@TK2MSF TNGP10.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.Imag e property...
"MuZZy" <le*******@yaho o.com> wrote in message
news:tpu_b.1108 80$uV3.598285@a ttbi_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********@box frog.com> wrote in message
news:pe******** ************@co mcast.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
12248
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 poor man's DBMS, a broken email server and various other /application/ servers to try and crack the Internet and IS markets. In the case where they didn't spend their own money to get companies to
1
436
by: HB2 | last post by:
Is it possible to obtain the IP address of my desktop using a Visual Basic command?
2
3302
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 copy a large (1 MB to 30 MB) MDB file from the desktop to the web server, replacing an existing file on the server. What is the best way to do this from within a VB.Net windows program?
5
1880
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 desktop, but i want to display images directly on the desktop surface. XP / VB.Net --GH
1
4450
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 user who is on a domain, but logged in locally. Specifically, for a corporate domain - the user logs into the local desktop and has a local profile - not a roaming profile. The below code is implemented in an NT service for the purpose of
0
879
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
36486
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
1526
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 it doesnt seem very efficient. my idea: i have a screenshot of the remote desktop refreshed every 100ms in a picture box. now i think if i get the mouse possition within this picture box and store it in a txt file every 100ms or less, i can have...
4
8107
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 it doesnt seem very efficient. my idea: i have a screenshot of the remote desktop refreshed every 100ms in a picture box. now i think if i get the mouse possition within this picture box and store it in a txt file every 100ms or less, i can have...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10053
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10001
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8880
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.