Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK .NET / Loading a resource dll...

Author
Message
Acolyte
18
Years of Service
User Offline
Joined: 3rd Feb 2006
Location:
Posted: 15th Jul 2009 05:13
Hey guys.

I've just recently switched to using the DGDK.NET in C# so I can code my current project a little quicker. Recently, I coded a program in which I compiled a resource DLL in vb.NET which contained a large number of images. I loaded this DLL into my program and utilized those images at runtime.

1. Can I reuse that same vb compiled DLL in C#?
2. If so, what is a simple routine for loading the DLL into memory and getting my jpeg images from the dll and using them with the DGDK.NET image/bitmap commands?

Thanks for your help guys!

Windows XP Home Ed. SP/2 ---> GeForce FX 5500 - 256MB
160 GB HD ---> 1 Gig RAM
kBessa
18
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 15th Jul 2009 16:51
1. Yes, you can!

2. The constructors on the Object Class Library do have overloads to load from an embedded resource. I just cannot tell you right now because I'm at work and don't have DGDK.NET here, but I'm sure it does have as I helped APEX desining it.

[center][center]
Acolyte
18
Years of Service
User Offline
Joined: 3rd Feb 2006
Location:
Posted: 16th Jul 2009 04:36
Hey kBessa, can you give me some idea of what I will need for commands to use to do this?

Anyone else know how I can load a resource DLL into c# and convert the jpegs in there into DGDK.NET images or sprites?

Windows XP Home Ed. SP/2 ---> GeForce FX 5500 - 256MB
160 GB HD ---> 1 Gig RAM
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 16th Jul 2009 08:39
@Acolyte - something like this?

http://www.keithelder.net/blog/archive/2007/12/14/How-To-Load-an-Embedded-Resource-From-A-DLL.aspx

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
Acolyte
18
Years of Service
User Offline
Joined: 3rd Feb 2006
Location:
Posted: 16th Jul 2009 08:53
@Niels: Yeah, that's a good start.

I really wonder if anyone has a specific example regarding getting images from a DLL instead of just calling functions or getting strings? I also need to make sure that once I get the image that I can convert it to a format that the GDK will be able to handle with its native image and sprite functions.

Windows XP Home Ed. SP/2 ---> GeForce FX 5500 - 256MB
160 GB HD ---> 1 Gig RAM
Acolyte
18
Years of Service
User Offline
Joined: 3rd Feb 2006
Location:
Posted: 16th Jul 2009 21:12
*bump*

Windows XP Home Ed. SP/2 ---> GeForce FX 5500 - 256MB
160 GB HD ---> 1 Gig RAM
kBessa
18
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 16th Jul 2009 23:23
Hum... I might try to help you on this. I'll get home later and will try to code some example for you. A C# program calling a VB.NET resource assembly will be fine?

For now, I can assure you it does load resources from its own assembly or from an external assembly.

Ok, I'll do it. Maybe it can be added as sample later.

[center][center]
Acolyte
18
Years of Service
User Offline
Joined: 3rd Feb 2006
Location:
Posted: 16th Jul 2009 23:48
Sweet, sounds great. That would be a big help to me and my project. Thanks for your help man!

Windows XP Home Ed. SP/2 ---> GeForce FX 5500 - 256MB
160 GB HD ---> 1 Gig RAM
Acolyte
18
Years of Service
User Offline
Joined: 3rd Feb 2006
Location:
Posted: 18th Jul 2009 09:55
@kBessa: Where ya at man?

Anyone else here know how to load a .NET resource DLL in c# and convert a loaded jpeg into an image the DGDK.NET can use with its image, bitmap, and sprite commands?

Windows XP Home Ed. SP/2 ---> GeForce FX 5500 - 256MB
160 GB HD ---> 1 Gig RAM
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 7th Aug 2009 14:20
Well I am not sure about .NET I have not had a chance to try it yet, but I am assuming you could go about using the System.Drawing.Image class to pull the recource from the DLL using a System.Runtime.ResourceManager

If you have the DLL and the App in the same solution you can just link it directly, and give the DLL a function that will return the Image.

As far as I know the DB functions for loading images only allow for filenames...

You could use the Image class to save the Image to a file; load it into DB using the filename; delete the file; convert it to a memblock; and finaly return the memblock to the calling aplication.

if(enemy == Amnzero) runAway();
Amnzero.WebSite = L"http://neovance.com/";

Login to post a reply

Server time is: 2024-11-21 13:45:05
Your offset time is: 2024-11-21 13:45:05