|
-
Apr 27th, 2003, 01:45 PM
#1
Thread Starter
Frenzied Member
Sending image over winsocket without saving file.. (sending directly)
I am trying to send images of the desktop to a remote computer for a while now... i managed to do it with bmp format but that is just to big.. i tried jpg but still isnt really fast.. is there anyway to send a part of the image without even saving the image?
i tried sending through a long value but can't seem to set the other picture to the long i recieved :S
btw i tried searching the board with no codes nor results answering my question :S
Last edited by Ultimasnake; Apr 27th, 2003 at 01:51 PM.
-
Apr 27th, 2003, 02:04 PM
#2
I'm not sure I fully understand but do you want to just send a part of an image? Something like "I have an image that is 400x200 pixels but I only want to send one part of it that is 30x20 pixels"???
-
Apr 27th, 2003, 02:05 PM
#3
Thread Starter
Frenzied Member
well not really (i want to do this later on but whatever) but i just want to send a picturebox.picture over the network.. and show it in another picture box without saving the picture on either sides....
-
Apr 27th, 2003, 02:07 PM
#4
The picture isn't missing
so do you mean you want to have some kind of blackboard application?
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Apr 27th, 2003, 02:09 PM
#5
Thread Starter
Frenzied Member
I am not telling what kind of app i want.. i just want to know how to send a image to a client app without having to save the darn file and then reading everything and sending it in parts.. just want to send it directly through the winsocket :S jeez :S
Last edited by Ultimasnake; Apr 27th, 2003 at 02:13 PM.
-
Apr 27th, 2003, 02:22 PM
#6
One very simple and quick way to convert an image to a byte array is to use a PropertyBag. However that creates a little overhead:
VB Code:
Dim pb As PropertyBag
Dim bArr() As Byte
Set pb = New PropertyBag
pb.WriteProperty "Image", Picture1.Picture, Nothing
bArr = pb.Contents
Another way would be to create a DIB (Device Independent Bitmap) since that will store the image directly in memory and return the address. There's an example on how to create a DIB and get it to a byte array available here:
http://www.vbaccelerator.com/codelib/gfx/dibsect.htm
Cheers.
-
Apr 27th, 2003, 02:27 PM
#7
You can try my control: SmartSocket, don't ask me how it works, just scroll down the page and read the descriptions for the events and functions to figure it out.
But if you wanna do it yourself, do a search on "bitmap to byte array" or something like that... then send the byte array, then on the receiving side, you will have to do the opposite, ie: byte array to bitmap
-
Apr 27th, 2003, 03:02 PM
#8
Thread Starter
Frenzied Member
i cant seem to find anything (that works) about converting the byte array back to the bitmap.. any help would be great thanks
-
Apr 27th, 2003, 03:22 PM
#9
If you use my PropBag example above it's very simple:
VB Code:
'assumes the bytes are stored in a byte array named bArr()
Set pb = New PropertyBag
pb.Contents = bArr
Picture1.Picture = pb.ReadProperty("Image", Nothing)
Of corse to save a few bytes you don't have to store the property as "Image"... you could use a shorter name
-
Oct 12th, 2003, 07:34 PM
#10
Addicted Member
I can't get to your website. Has the URL changed? I'd love to try out your smartsocket.
Brandon
Originally posted by CVMichael
You can try my control: SmartSocket, don't ask me how it works, just scroll down the page and read the descriptions for the events and functions to figure it out.
But if you wanna do it yourself, do a search on "bitmap to byte array" or something like that... then send the byte array, then on the receiving side, you will have to do the opposite, ie: byte array to bitmap
-
Oct 12th, 2003, 10:26 PM
#11
I'm having problem with my computer, it stops responding and then shuts off by itself. I have my website on my own computer, so untill I fix my computer, the web-site will be off too. Right now i'm writing from my laptop, but on it I don't have enough room to install all the neccessary stuff to run the web-site.
-
Oct 15th, 2003, 03:51 PM
#12
Addicted Member
Sounds like the MSBlaster worm to me.
How large is the .OCX?
Perhaps you can email it to me?
-Brandon-
-
Oct 16th, 2003, 08:34 PM
#13
PM me with your e-mail, and I'll send it to you when I have time... the file is ~ 180KBytes
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|