Sign in to follow this  

Sending images repeatedly and quickly.. over the internet

This topic is 4746 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Long version: (scroll down to see the short version) Hello. I wanted to make a small application where you can control another computer from far away.. So far I have a server and a client, adn the server is on the computer I want to control, and the client is on the computer that is controlling it. I'm sending messages of what to do (move the mouse, etc.) to the server, which then executes them. One problem.. I can't see what I am doing! So, I figured I'd send images back to the client to show where everything is on the screen (based on the messages sent, I'll know where the mouse is) So I have the server taking screenshots every second, but I have a bit of a problem. I need to convert the image that I got from prtscrn, on the clipboard, and I need to convert that into something very small (I've been thinking jpg.) and then I need to get the size of that image (in bytes) so I can send it.. By the way, I did this all in visual basic, because I wanted to develop it quickly, and I'm planning on using it for myself, so it doesn't have to be commercial quality or anything. Please help me out. Short version: I have an image on the clipboard, I need to convert it into a small image type (jpg or something) and find the size of it in bytes. How can I do that? Visual basic.... Thanks. ~Adams555~

Share this post


Link to post
Share on other sites
Some free code to handle jpeg files. I used a version of this about 10 years ago. It was pretty simple. You provide a "read" function, and a "store a line of 24 bit uncompressed data" function. You'll want the other way too, with a "write" function, and a "read a line of 24 bit uncompressed data" function. The read and write functions can access a file, read/store in memory, send/receive packets over the net, whatever you want.

It was a bit of a pain to find which file had the sample that showed how easy to use it was, but once that was done, actually using it was simple. The code (assuming it's not changed) is C. I'm assuming you can get C and VB to communicate.

The only stipulation to using the code in a commercial product (as of 10 years ago... who knows what it is now) was that you include a statement about how your work is based in part upon their work. Not a biggie.

Share this post


Link to post
Share on other sites
just store the last two images,
Xor them
And compress the image you need to send.

Then on the other end, decompress the image, and xor it with the last image you recieved. It hopefully should be the origional one.

Why xor?
1. Its fast
2. It gets rid of data thats clost to, or is the same between pictures (1 xor 1 = 1, 0 xor 0 = 0)

From,
Nice coder

Share this post


Link to post
Share on other sites
I'd reduce the number of colours and use a GIF myself - the filesizes are likely to be a lot smaller, especially if you really strip down the colours.

It does sound a lot like VNC, I've used VNC a lot before in the past (remote administration of servers) and it's pretty good.

Share this post


Link to post
Share on other sites
JPEG isn't a good idea for remote desktop apps, it makes text unreadable at higher compression ratios...

I'd go with sending only changed parts (xor seems to be a good way of doing this) and gif or png for compression.

Share this post


Link to post
Share on other sites
Quote:
Original post by evolutional
I'd reduce the number of colours and use a GIF myself - the filesizes are likely to be a lot smaller, especially if you really strip down the colours.


::wearing my slashdot linux open source radical pinko commie hat:: You misspelled "PNG". [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by evolutional
Quote:
Original post by Zahlman
::wearing my slashdot linux open source radical pinko commie hat:: You misspelled "PNG". [smile]


Can you tell I'm a ex- windows user? [grin]


"You mispelled 'PNG', ya ex-Windows user!" [grin]

Share this post


Link to post
Share on other sites

This topic is 4746 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this