diff --git a/SpriteLibrary/Properties/Resources.Designer.cs b/SpriteLibrary/Properties/Resources.Designer.cs index 11a7542..eb1555f 100644 --- a/SpriteLibrary/Properties/Resources.Designer.cs +++ b/SpriteLibrary/Properties/Resources.Designer.cs @@ -61,8 +61,8 @@ namespace SpriteLibrary.Properties { } /// - /// Looks up a localized string similar to {\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 00000000000000000000}Cambria Math;} - ///{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f40\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}{\flomajor [rest of string was truncated]";. + /// Looks up a localized string similar to {\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f34\fbidi \froman\fcharset1\fprq2{\*\panose 02040503050406030204}Cambria Math;} + ///{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f40\fbidi \fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Consolas;}{\flomajor [rest of string was truncated]";. /// internal static string ChangeLog { get { @@ -89,5 +89,15 @@ namespace SpriteLibrary.Properties { return ((System.Drawing.Icon)(obj)); } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap X { + get { + object obj = ResourceManager.GetObject("X", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/SpriteLibrary/Resources/X.png b/SpriteLibrary/Resources/X.png new file mode 100644 index 0000000..3133698 Binary files /dev/null and b/SpriteLibrary/Resources/X.png differ diff --git a/SpriteLibrary/SmartImage.cs b/SpriteLibrary/SmartImage.cs index 062da55..6d72a7a 100644 --- a/SpriteLibrary/SmartImage.cs +++ b/SpriteLibrary/SmartImage.cs @@ -94,6 +94,17 @@ namespace SpriteLibrary y += height; x = 0; } + //If we managed to send it a bad size or something and we could not make a single image. + if(Frames.Count ==0) + { + Bitmap tImage = new Bitmap(width, height); + Image XImage = Properties.Resources.X; + Graphics.FromImage(tImage).DrawImage(Properties.Resources.X,0,0,tImage.Width,tImage.Height); + AnimationSingleFrame newSingle = new AnimationSingleFrame(tImage, Smart_Image.FrameCount); + AnimationFrame newFrame = new AnimationFrame(Smart_Image.FrameCount, TimeSpan.FromMilliseconds(duration)); + Frames.Add(newFrame); + Smart_Image.AddFrame(newSingle); + } } /// @@ -131,6 +142,17 @@ namespace SpriteLibrary y += height; x = 0; } + //If we managed to send it a bad size or something and we could not make a single image. + if (Frames.Count == 0) + { + Bitmap tImage = new Bitmap(width, height); + Image XImage = Properties.Resources.X; + Graphics.FromImage(tImage).DrawImage(Properties.Resources.X, 0, 0, tImage.Width, tImage.Height); + AnimationSingleFrame newSingle = new AnimationSingleFrame(tImage, Smart_Image.FrameCount); + AnimationFrame newFrame = new AnimationFrame(Smart_Image.FrameCount, TimeSpan.FromMilliseconds(duration)); + Frames.Add(newFrame); + Smart_Image.AddFrame(newSingle); + } } internal Animation(SmartImage Smart_Image, int AnimationToCopy, bool MirrorHorizontally, bool MirrorVertically) diff --git a/SpriteLibrary/SpriteLibrary.csproj b/SpriteLibrary/SpriteLibrary.csproj index 5c110f4..6fb4541 100644 --- a/SpriteLibrary/SpriteLibrary.csproj +++ b/SpriteLibrary/SpriteLibrary.csproj @@ -89,6 +89,9 @@ + + +