This project has moved and is read-only. For the latest updates, please go here.

Changes in Drawable

Feb 26, 2016 at 4:56 AM
Hello, I just updated my application to use the latest version of Magick.Net and am running into a few issues. Most I think I have resolved due to some changes but I am having problems with converting some existing code. For instance the following code is not being accepted when I try to draw an outline. It appears the Drawable class is no longer there. Any ideas what I may need to do differently.

            int DestWidth = DestinationImage.Width;
            int DestHeight = DestinationImage.Height;
            int LineThickness = 1;

            List<Drawable> Outline = new List<Drawable>();

            Outline.Add(new DrawableStrokeColor(Color.LightGray));
            if (useDashedLinesToolStripMenuItem.Checked)
            {

                double[] dash = new double[] { 10, 10 };
                Outline.Add(new DrawableDashArray(dash));

            }

            Outline.Add(new DrawableStrokeWidth(LineThickness));
            Outline.Add(new DrawableLine(LineThickness, LineThickness, DestWidth - LineThickness, LineThickness));
            Outline.Add(new DrawableLine(DestWidth - LineThickness, LineThickness, DestWidth - LineThickness, DestHeight - LineThickness));
            Outline.Add(new DrawableLine(DestWidth - LineThickness, DestHeight - LineThickness, LineThickness, DestHeight - LineThickness));
            Outline.Add(new DrawableLine(1, DestHeight - LineThickness, LineThickness, LineThickness));
            DestinationImage.Draw(Outline);
Feb 26, 2016 at 5:04 AM
Never mind. I figured this out. Not sure why I was having so much difficulty doing so bot for anyone that is interested the drawable class seems to have been replaced with the IDrawable class and the DrawableDashArray is now DrawableStrokeDashArray.
 int DestWidth = DestinationImage.Width;
            int DestHeight = DestinationImage.Height;
            int LineThickness = 1;

            // List<Drawable> Outline = new List<Drawable>();
            List<IDrawable> Outline = new List<IDrawable>();

            Outline.Add(new DrawableStrokeColor(Color.LightGray));
            if (useDashedLinesToolStripMenuItem.Checked)
            {
                
                double[] dash = new double[] { 10, 10 };
               // Outline.Add(new DrawableDashArray(dash));
                Outline.Add(new DrawableStrokeDashArray(dash));
            }

            Outline.Add(new DrawableStrokeWidth(LineThickness));
            Outline.Add(new DrawableLine(LineThickness, LineThickness, DestWidth - LineThickness, LineThickness));
            Outline.Add(new DrawableLine(DestWidth - LineThickness, LineThickness, DestWidth - LineThickness, DestHeight - LineThickness));
            Outline.Add(new DrawableLine(DestWidth - LineThickness, DestHeight - LineThickness, LineThickness, DestHeight - LineThickness));
            Outline.Add(new DrawableLine(1, DestHeight - LineThickness, LineThickness, LineThickness));
            DestinationImage.Draw(Outline);