I need to find a way of transfering a Picture (that the user will just have drawn) into a Array. I can't save the image
Printable View
I need to find a way of transfering a Picture (that the user will just have drawn) into a Array. I can't save the image
You mean, the user draws it on a picture bos?
In that case, you can try: Pictur1.Picture = Picture1.Image (maybe you need Set picture....), then you can save it with the VB function.
Sorry, didn't make myself clear. I need to transfer a picture to a array of bytes (which gets sent to a webpage). And I can't save the picture and reload it into the array.
That makes more sence.. Actually I don't know... Never had any need to do that.
Maybe you can use a memcopy?
What is the source of the picture? Is that a picturebox, or something else?
The picture is generated at runtime in a PictureBox control. I can copy this to another PictureBox or save it, but... Since I don't know the address where it's stored, I can't do a CopyMemory.... Any ideas?
Can you use Picture.Picture as source for the copy?
On the other hand, if you can save the picture, you can try to read that bitmap out. It contains a few headerinfo structures (user defined types), and an array of bytes. Maybe that's an option. I haven't done that (no need to...), but it can't be that hard to do.
I should have said: I know how to save it, but I can't this time. So no Saving!
All the copy commands I have found, either take copy picture to picture or memory to memory.... I can't seem to go from Picture to memory directly.
Hmm.... I'm, not sure how to do it out of my head, but maybe you can create a compatible dc in memory, vopy the picture to that dc, and copy it from that dc into the byte-array (although, if this works, it should work when you try to copy the picture dc to the array, and I doubt that, but maybe it's worth a try).
Ever been to http://www.insidetheweb.com/messageb...bs.cgi/mb62639 ?
Messageboard about games and graphing programming, maybe you find some usefull info there.