1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System.Drawing;
- namespace NTERA.EmuEra.Game.EraEmu.Content
- {
- internal sealed class BaseImage : AContentFile
- {
- public BaseImage(string name, string path)
- : base(name, path)
- { }
- public Bitmap Bitmap;
- Graphics g;
- public void Load(bool useGDI)
- {
- if (Loaded)
- return;
- try
- {
- Bitmap = new Bitmap(Filepath);
- //if (useGDI)
- //{
- // hBitmap = Bitmap.GetHbitmap();
- // g = Graphics.FromImage(Bitmap);
- // GDIhDC = g.GetHdc();
- // hDefaultImg = GDI.SelectObject(GDIhDC, hBitmap);
- //}
- Loaded = true;
- Enabled = true;
- }
- catch
- {
- return;
- }
- }
- public override void Dispose()
- {
- if (Bitmap == null)
- return;
- if (g != null)
- {
- g.Dispose();
- g = null;
- }
- Bitmap.Dispose();
- Bitmap = null;
- }
- ~BaseImage()
- {
- Dispose();
- }
- }
- }
|