diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-01 23:31:22 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-01 23:31:22 +0100 |
| commit | 47fe040bb568b4eff544bb9f287481343216373e (patch) | |
| tree | 497c57cb3028d54f01d4d5748743dd0af69a77ab /src/GraphicObjects/Image.cs | |
| parent | 9fa17cdc9487e3ba92ef467c0c6d5d9941530de1 (diff) | |
debug and improvments
Diffstat (limited to 'src/GraphicObjects/Image.cs')
| -rw-r--r-- | src/GraphicObjects/Image.cs | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/src/GraphicObjects/Image.cs b/src/GraphicObjects/Image.cs index 0aa48ac7..e7f75fe8 100644 --- a/src/GraphicObjects/Image.cs +++ b/src/GraphicObjects/Image.cs @@ -15,7 +15,36 @@ namespace Crow {
Picture _pic;
string _svgSub;
-
+ bool scaled;
+ [XmlAttributeAttribute()][DefaultValue(true)]
+ public virtual bool Scaled {
+ get { return scaled; }
+ set {
+ if (scaled == value)
+ return;
+ scaled = value;
+ NotifyValueChanged ("Scaled", scaled);
+ if (_pic == null)
+ return;
+ _pic.Scaled = scaled;
+ registerForGraphicUpdate ();
+ }
+ }
+ bool keepProps;
+ [XmlAttributeAttribute()][DefaultValue(true)]
+ public virtual bool KeepProportions {
+ get { return keepProps; }
+ set {
+ if (keepProps == value)
+ return;
+ keepProps = value;
+ NotifyValueChanged ("KeepProportions", keepProps);
+ if (_pic == null)
+ return;
+ _pic.KeepProportions = keepProps;
+ registerForGraphicUpdate ();
+ }
+ }
[XmlAttributeAttribute("Path")]
public string Path {
get { return _pic == null ? null : _pic.Path; }
@@ -26,7 +55,8 @@ namespace Crow return;
}
LoadImage (value);
- _pic.KeepProportions = true;
+ _pic.Scaled = scaled;
+ _pic.KeepProportions = keepProps;
} catch (Exception ex) {
Debug.WriteLine (ex.Message);
_pic = null;
@@ -47,23 +77,6 @@ namespace Crow public Image () : base()
{
}
- public Image (string _imgPath, Rectangle _bounds)
- : base(_bounds)
- {
- LoadImage(_imgPath);
- }
- public Image (string _imgPath)
- : base()
- {
- LoadImage(_imgPath);
- }
-// public Image (System.Drawing.Bitmap _bitmap)
-// : base()
-// {
-// _pic = new BmpPicture ();
-//
-// LoadImage (_bitmap);
-// }
#endregion
#region Image Loading
|