FS#145 - Implement copy constructors and ToString functions in SFML.Net

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1330 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2010-01-06 12:37:29 +00:00
parent bd9a60fef2
commit dd255a916d
28 changed files with 627 additions and 0 deletions

View file

@ -120,6 +120,17 @@ namespace SFML
throw new LoadingFailedException("image");
}
////////////////////////////////////////////////////////////
/// <summary>
/// Construct the image from another image
/// </summary>
/// <param name="copy">Image to copy</param>
////////////////////////////////////////////////////////////
public Image(Image copy) :
base(sfImage_Copy(copy.This))
{
}
////////////////////////////////////////////////////////////
/// <summary>
/// Save the contents of the image to a file
@ -297,6 +308,20 @@ namespace SFML
get {return sfImage_GetHeight(This);}
}
////////////////////////////////////////////////////////////
/// <summary>
/// Provide a string describing the object
/// </summary>
/// <returns>String description of the object</returns>
////////////////////////////////////////////////////////////
public override string ToString()
{
return "[Image]" +
" Width = " + Width +
" Height = " + Height +
" Smooth = " + Smooth;
}
////////////////////////////////////////////////////////////
/// <summary>
/// Internal constructor
@ -338,6 +363,9 @@ namespace SFML
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfImage_CreateFromFile(string Filename);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
static extern IntPtr sfImage_Copy(IntPtr Image);
[DllImport("csfml-graphics"), SuppressUnmanagedCodeSecurity]
unsafe static extern IntPtr sfImage_CreateFromMemory(char* Data, uint Size);