示例#1
0
        public CanvasSlim()
        {
            MaxJsonLength = 100 * 1024 * 1024; // 100 MB
            Layers        = new LayerCollection(this);

            Tags = new Dictionary <string, object>();

            ScreenXDpi = 96F;
            ScreenYDpi = 96F;
            Zoom       = 1;

            MultipleSelectionEnabled = false;
            MouseMoveTimeout         = 100;
        }
示例#2
0
 private void SwitchCollectionTracking(LayerCollection layerCollection, bool enable)
 {
     if (enable)
     {
         Layers.ItemAdded            += LayerCollection_ItemAdded;
         Layers.ItemRemoved          += LayerCollection_ItemRemoved;
         Layers.ItemMoved            += LayerCollection_ItemMoved;
         Layers.SelectedIndexChanged += LayerCollection_SelectedIndexChanged;
     }
     else
     {
         Layers.ItemAdded            -= LayerCollection_ItemAdded;
         Layers.ItemRemoved          -= LayerCollection_ItemRemoved;
         Layers.ItemMoved            -= LayerCollection_ItemMoved;
         Layers.SelectedIndexChanged -= LayerCollection_SelectedIndexChanged;
     }
 }
示例#3
0
        public Canvas()
            : base("canvas")
        {
            MaxJsonLength = 10000000;

            History = new History(this);

            ReturnValue         = null;
            WorkspaceHeight     = 72F;
            WorkspaceWidth      = 72F;
            IsSquaredBackground = true;
            MarginColor         = new RgbColor(0, 0, 0, 255);
            MarginWidth         = 0F;
            Margin = UnitConverter.ConvertUnitsToUnits(300.0F, 0.25F, Unit.Inch, Unit.Point);
            ConstrainedMarginEnabled = false;

            SelectionColor = new RgbColor(0, 0, 255, 178);
            SelectionWidth = 2;

            ScreenXDpi = 96F;
            ScreenYDpi = 96F;

            RotationGripSize       = 8;
            RotationGripColor      = new RgbColor(0, 0, 255, 51);
            RotationGripLineLength = 12;
            RotationGripLineColor  = new RgbColor(0x70, 0x70, 0x70, 0xFF);

            ResizeGripSize      = 8;
            ResizeGripColor     = new RgbColor(255, 255, 255, 255);
            ResizeGripLineColor = new RgbColor(0xFF, 0x0, 0x0, 0xFF);

            SelectButtonTitle = "Select image";
            EditButtonTitle   = "Edit";
            DoneButtonTitle   = "Done";

            Tags = new Dictionary <string, object>();

            Layers = new LayerCollection(this);
            SwitchCollectionTracking(Layers, true);

            MultipleSelectionEnabled = false;
            MouseMoveTimeout         = 100;
        }