473,503 Members | 2,435 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

where is the desktop image stored && how can i read it

30 New Member
hy

i want to write a program that can determin the code ( the 32 bit diget ) of a specific pixel on the desktop.
can i somehow get the memory adress of the desktop image or is there a predifined function that can return the code of a specific pixel ( ex: meaby somting like "int get_pixel(int x, int y) " ) ?

i'm usin win xp pro sp2 and visual c++ 2005
Dec 24 '06 #1
3 1972
macklin01
145 New Member
This may not be the most efficient way to do it, but I did write some win32 extensions for my EasyBMP C++ bitmap library.

The included code sample does a screen capture to a BMP bitmap image. (You can examine the source to determine how it works.) If you want to capture only the desktop, you'd have to find the win32 command to minimize all windows. (This and
this may get you started.)

Suppose then that you have captured the screen to a BMP object ScreenCap. Then you'd get the (i,j) pixel as follows:

Expand|Select|Wrap|Line Numbers
  1. cout << "pixel (i,j) is (" << (int) Image(i,j)->Red << "," 
  2.      << (int) Image(i,j)->Green << ","
  3.      << (int) Image(i,j)->Blue << ","
  4.      << (int) Image(i,j)->Alpha << ")" << endl;
  5.  
You can combine these red, green, blue, and alpha values as you see fit. For instance, to put them into a 32-bit number, I guess you might do this:
Expand|Select|Wrap|Line Numbers
  1. int AllTogether = 255*255*255*Image(i,j)->Blue
  2.                 + 255*255*Image(i,j)->Green
  3.                 + 255*Image(i,j)->Red
  4.                 + Image(i,j)->Alpha;
  5.  
(Note that the RGBQUAD data type in win32 stores in order of blue, green, red, alpha). Now, I may have my data reversed, in which case you'd want to reverse my code sample to alpha, red, green, blue.

I hope this gets you started. -- Paul
Dec 24 '06 #2
asdfghjkl2007
30 New Member
thanks

you have just oppend a new part of programing to me ( i never tried to work with pictures of any kind)

but you were wright " this isen't the best way" to do what i want in my program.
maby i didn't discribed whit inaf detalies so :

my program shold retrive a pixel (it doesent mather in what format it stores it) from desktop and sed it to another program over the internet and the program at the other end (runnig in fool screen ) should be able to show it at the same position it was on the first desktop.
Dec 24 '06 #3
macklin01
145 New Member
thanks

you have just oppend a new part of programing to me ( i never tried to work with pictures of any kind)

but you were wright " this isen't the best way" to do what i want in my program.
maby i didn't discribed whit inaf detalies so :

my program shold retrive a pixel (it doesent mather in what format it stores it) from desktop and sed it to another program over the internet and the program at the other end (runnig in fool screen ) should be able to show it at the same position it was on the first desktop.
Ah, that sounds like a remote desktop / virtual network client type of application. You'd have to start looking at TCP/IP after that.

You might consider looking at TightVNC. It's a very good app, and if it's something you're still interested in doing yourself, you could look at their code, as it's GPL. -- Paul

*edit*
Another way to do this would be to take screencaps at regular intervals and use a command-prompt type of emailer (e.g., sendmail) to email the screencaps wherever they need to go, or upload them to an http server. So, you could have somethign like http://some.site.com/remote.bmp that gets updated every minute by ftp or sftp upload based upon your software. WinSCP has the option to keep a remote director synced, so that would work just fine.
*/edit*
Dec 24 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
6305
by: Mike Albrecht | last post by:
Hello Group, Pardon any cross posting. We wanted to replace the standard submit buttons on a web form with custom 'image' buttons. Here's the code I used: <input type="image"...
8
2594
by: Jef Driesen | last post by:
I'm implementing some image processing algorithms in C++. I created a class called 'image' (see declaration below), that will take care of the memory allocations and some basic (mathematical)...
4
28139
by: Ed Landau | last post by:
In VB6.0, I can put an image on a form and assign it's .picture property at run-time. In VBA (within MS Access), when I put down an image control on a form, it asks me for the source to the image...
0
259
by: Jason | last post by:
I have been trying to display pictures on my webpage on both imagebutton and image controls. I have tried adding the pictures at runtime (image1.imageURL = "pic.jpg") and setting the imageURL in...
1
1373
by: Stan Sainte-Rose | last post by:
Hi, I m trying to add a picturebox into a Winform. But when I load a new form using .show the picturebox appears in front of the loaded form. Is it possible to display the form in front of the...
0
947
by: ivan.dm | last post by:
Hi Body, Can I set an image from file into DrawArea, so I can resize and drawing any object over its image? any tips or idea? Thanks Ivan
1
1036
by: Ulhas | last post by:
Hello frendz, I stucked to integrate both image & texts as a one part. How to integrate those in a one form. plz help
2
2242
by: devnew | last post by:
hi i am new to python and PIL and was trying to write a class to read and write RGB color model jpeg images.. i came up with this class below..i want to know if this is the way to read/write the...
0
1134
by: lhoracio | last post by:
Hi, I've got a small app in VB6 with MySQL. Works fine, but I found I would need to embedd some images on text displayed in a RTF control. I have no problem in pasting it to the control....
0
7188
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
7258
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
7313
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...
1
6970
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
7441
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...
1
4987
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...
0
3156
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...
0
1489
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
366
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...

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.