diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-09-09 12:33:45 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-09-09 12:33:45 +0200 |
| commit | 83a4710020bc9e254241bdce880d20bcbcec0bee (patch) | |
| tree | 6c3d80154d1e791996de2de11f3fa8398662a7f9 /src/Picture.cs | |
| parent | 0c200d4ae4f0f4a7a7c58c3affc7670eb6b2dcff (diff) | |
use Interface.GetStreamFromPath to handle either file or resource in
every loading places
Diffstat (limited to 'src/Picture.cs')
| -rw-r--r-- | src/Picture.cs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/Picture.cs b/src/Picture.cs index df96733c..411f3eb4 100644 --- a/src/Picture.cs +++ b/src/Picture.cs @@ -41,16 +41,12 @@ namespace go #region Image Loading public void LoadImage (string path) { - if (path.StartsWith ("#")) - loadFromRessource (path.Substring (1)); - else - loadFromFile (path); + loadFromStream (Interface.GetStreamFromPath (path)); Path = path; } - - protected abstract void loadFromRessource(string resId); - protected abstract void loadFromFile(string path); + + protected abstract void loadFromStream(Stream stream); #endregion public abstract void Paint(Context ctx, Rectangle rect, string subPart = ""); |