EOSERV Forum > Client Editing > Loading GFX files in C#?
Topic is locked.
Page: << 1 >>
Loading GFX files in C#?
Author Message
Post #47242 Loading GFX files in C#?

Most of you kids are C++ programmers, but I'm wondering if anyone knows how to load the gfx files using C#. I looked at the eomap source but there isn't really an easy port like there was for loading pub files -.-

I also searched for a couple hours on this with a lot of frustration, but maybe I was searching for the wrong thing. If someone could point me in the right direction that would be greatly appreciated!

---
class EOSERV {
Programmer | Oldbie
Open source EO Client: https://github.com/ethanmoffat/EndlessClient
};
15 years, 43 weeks ago
Post #47244 Re: Loading GFX files in C#?

Incase you hadn't thought about it, eomap lags alot when loading the gfx. Just saying incase you were thinking of using that. What are you doing if you don't mind me asking?

---
Web developer, currently looking for graphic artists / designers.
15 years, 43 weeks ago
Post #47245 Re: Loading GFX files in C#?

I was going to be original (xD) and try to make my own client. Or at least enough of a source that other people could add stuff to. Just a fun little thing I was trying and then kinda gave up on.

---
class EOSERV {
Programmer | Oldbie
Open source EO Client: https://github.com/ethanmoffat/EndlessClient
};
15 years, 43 weeks ago
Post #47246 Re: Loading GFX files in C#?

I like how you said 'kids' to make us think we're all not as cool as you. But, don't worry, i am specialized(:P) in C++ & C#. Just use the dll import function to import LoadImage & LoadLibrary. Or you are welcome to make a PE file loader yourself and load the bitmap. Which I have alreadytried and failed miserably. Anyways, here's the code, don't ask where to put it, figure it out:


        [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        static extern IntPtr LoadLibrary(string lpFilename);

        [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        static extern bool FreeLibrary(IntPtr hModule);

        [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
        static extern IntPtr LoadImage(IntPtr hinst, IntPtr hName, uint uType,
            int cxDesired, int cyDesired, uint fuLoad);

        [DllImport("gdi32.dll")]
        static extern bool DeleteObject(IntPtr hObject);


Note: This is not the best method, it is kind of ugly, but there isn't another way possible currently besides making your own.


Oh yeah, I had also tried making a client. Do not use XNA, it shitty as hell. To use a simple ass font you have to require it by the .exe. I like built in portable fonts, which is why i'm making my new client out of Allegro.

---
http://www.addipop.com
15 years, 43 weeks ago
Post #47249 Re: Loading GFX files in C#?

Yeah I already tried XNA. Didn't go well. And I always call groups of people "kids" :P 

Anyways, thanks for the solution! Don't think I'll be making my own PE loader any time soon...so this will work just fine!

---
class EOSERV {
Programmer | Oldbie
Open source EO Client: https://github.com/ethanmoffat/EndlessClient
};
15 years, 43 weeks ago
Post #48575 Re: Loading GFX files in C#?

:P Can't hate on XNA because it can do amazing stuff when you know how to use it ;).



---
¨°º¤ø„º°¨ Exile Studios ¨°º„ø¤º°¨
15 years, 42 weeks ago
Post #48581 Re: Loading GFX files in C#?
Deathx posted: (6th Sep 2010 06:08 pm)

:P Can't hate on XNA because it can do amazing stuff when you know how to use it ;).



Look how shitty the font is. Plus let's see the FPS and see if I can't top that with my allegro client :P

---
http://www.addipop.com
15 years, 42 weeks ago
Post #48600 Re: Loading GFX files in C#?


Lets not mention that XNA has some serious compatabillity issues xD

---
Hmm.
15 years, 42 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > Client Editing > Loading GFX files in C#?