2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
#region ================== Copyright (c) 2007 Pascal vd Heiden
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
|
|
|
|
* This program is released under GNU General Public License
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Namespaces
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.Data
|
|
|
|
{
|
|
|
|
public sealed class UnknownImage : ImageData
|
|
|
|
{
|
|
|
|
#region ================== Variables
|
|
|
|
|
2014-12-03 09:06:05 +00:00
|
|
|
private readonly Bitmap loadbitmap;
|
2009-04-19 18:07:22 +00:00
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Constructor / Disposer
|
|
|
|
|
|
|
|
// Constructor
|
2020-01-13 18:11:10 +00:00
|
|
|
public UnknownImage()
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
|
|
|
// Initialize
|
|
|
|
this.width = 0;
|
|
|
|
this.height = 0;
|
2020-03-19 14:46:04 +00:00
|
|
|
this.loadbitmap = new Bitmap(Properties.Resources.UnknownImage);
|
2009-04-19 18:07:22 +00:00
|
|
|
SetName("");
|
|
|
|
|
2020-01-12 22:10:57 +00:00
|
|
|
LoadImageNow();
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region ================== Methods
|
|
|
|
|
|
|
|
// This 'loads' the image
|
2019-12-29 02:54:12 +00:00
|
|
|
protected override LocalLoadResult LocalLoadImage()
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
2020-01-13 18:11:10 +00:00
|
|
|
return new LocalLoadResult(new Bitmap(loadbitmap));
|
2019-12-29 02:54:12 +00:00
|
|
|
}
|
2009-04-19 18:07:22 +00:00
|
|
|
|
2019-12-29 02:54:12 +00:00
|
|
|
// This returns a preview image
|
|
|
|
public override Image GetPreview()
|
2009-04-19 18:07:22 +00:00
|
|
|
{
|
2019-12-29 02:54:12 +00:00
|
|
|
// To do: do we actually need a copy here?
|
|
|
|
return new Bitmap(loadbitmap);
|
2009-04-19 18:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|