Vankwysha
Squire
Australia
43 Posts |
Posted - May 07 2005 : 04:13:53 AM
|
Hmmm, I spose that is a good point. Maybe I'll worry about this stuff once I'm done.
|
|
|
Crysstaafur
Squire
USA
37 Posts |
Posted - May 07 2005 : 06:54:34 AM
|
One quick question Van, the 'variable' that you are trying to stash your image into, is it an actual variable, a label for an object, an indexed array, or a pointer address?
Also if the function you are trying to call is asking for a filename, the only two ways I know of feeding it info break down to simple and hard as hell...
if you've settled the file issue then ignore the rest of this post... :)
simple:feed a file into the function.(the state of the file doesn't matter as long as it matches what it expected when said function is called...)
complex:(sighs) try finding out what memory address or object the function is attempting to load the image into, then simply pop the information into that. This undoubtedly would require some skill with win32 asm or an uncanny grasp of memory manipulation.. either way.. the issue of learning the internals of the functions binary is an issue.. I am still not 100% on whether that would even work...
2dCoder: 'So long and thanks for all the fish...' lol |
|
|
Vankwysha
Squire
Australia
43 Posts |
Posted - May 07 2005 : 7:36:31 PM
|
The function can take a FileStream or a System.Drawing.Bitmap object, so eventually I will load my bitmap into one of those, but for now I'll just concentrate on converting the rest of my game from VB6 to VB.NET. |
|
|
2dcoder
Knave
83 Posts |
Posted - May 08 2005 : 04:12:23 AM
|
hmm, curious... since it sounds like you already have it working in vb6, what benefits do you see going to VB.Net? Better performance, better compatbility for end users ? ? |
|
|
Vankwysha
Squire
Australia
43 Posts |
Posted - May 08 2005 : 3:55:26 PM
|
Well, I didn't have it working in VB6 to start with, since then I've made some major revisions to the design of the game that just wouldn't work with VB6, and also because I no longer own VB6. |
|
|
Eric Coleman
Gladiator
USA
811 Posts |
Posted - May 09 2005 : 10:51:06 PM
|
The fact that you can load data from a "stream" or "bitmap" ojbect seems to have been ignored in this thread. The "stream" object allows you to load graphical data from memory, which is what you're asking about. The trick is to make sure that the data in your stream is uncompressed, which is what you have to do regardless of how you store or use the data.
Are you having trouble reading data from a file or are you having trouble uncompressing the data or what? The concept of what you need to do is simple, Disk -> Uncompress -> Memory -> CreateSurfaceFromMemory. Lachlan already told you how to do that last part, use system.IO.Stream.
|
|
|
Vankwysha
Squire
Australia
43 Posts |
Posted - May 10 2005 : 04:24:52 AM
|
So far, I've been able to compress and decompress my images, and I know how to load a bitmap or stream object into the draw sub, however, I haven't worked out how to make the link between. Once I decompress the data, it just sits in a binary variable. How do I then load that variable into a stream (or bitmap)? |
|
|
Eric Coleman
Gladiator
USA
811 Posts |
|
Vankwysha
Squire
Australia
43 Posts |
Posted - May 11 2005 : 04:40:52 AM
|
Well, I've finally figured it out. It's taken a while, but I've now got my bitmaps decrypted successfully and loaded as sprites. I'd just like to thank all of you for your time and help. |
|
|
Eric Coleman
Gladiator
USA
811 Posts |
Posted - May 11 2005 : 10:15:34 AM
|
Any tips or suggestions for the rest of us on how you did it? |
|
|
Vankwysha
Squire
Australia
43 Posts |
Posted - May 14 2005 : 07:45:22 AM
|
I haven't had time over the last few days to fully implement my solution, but I have got the basics working.
Basically, I've simply removed the compression from the file format (as it overly complicates things) and simply have each of the bitmaps one after the other in a single file. One of my friend designed a DLL which contains the necessary classes and functions for packing and unpacking bitmaps into a single file, and once I fully understand this I'll be happy to share the full solution.
However, once the images have been unpacked, I simply store them in byte arrays and then load them into memory stream objects.
Again, thanks all round. |
|
|