This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.
chovy-gm/GMAssetCompiler/ViewBackground.cs

24 lines
619 B
C#

using System.Drawing;
using System.Drawing.Imaging;
namespace GMAssetCompiler
{
public class ViewBackground : View<GMBackground>
{
public ViewBackground(GMBackground _entry)
: base(_entry)
{
}
public override Image PrepareImage()
{
Bitmap bitmap = new Bitmap(m_this.Width, m_this.Height, PixelFormat.Format32bppArgb);
Rectangle rect = new Rectangle(0, 0, m_this.Width, m_this.Height);
BitmapData bitmapData = bitmap.LockBits(rect, ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
CopyBits(bitmapData, 0, 0, m_this.Bitmap);
bitmap.UnlockBits(bitmapData);
return bitmap;
}
}
}