Exemple #1
0
        public void Draw(IEditableFrame Editor, Func <Point, Point> PointTransform = null)
        {
            var img = GetImage(Editor);

            if (img == null)
            {
                return;
            }

            var targetSize = new Size(img.Width, img.Height);

            try
            {
                if (Settings.Resize)
                {
                    targetSize = new Size(Settings.ResizeWidth, Settings.ResizeHeight);
                }

                var point    = GetPosition(new Size((int)Editor.Width, (int)Editor.Height), targetSize);
                var destRect = new Rectangle(point, targetSize);

                Editor.DrawImage(img, destRect, Settings.Opacity);
            }
            catch { }
            finally
            {
                if (_disposeImages)
                {
                    img.Dispose();
                }
            }
        }
Exemple #2
0
        protected void Draw(IEditableFrame Editor, IBitmapImage Image, PointF Position, SizeF?Size, int Opacity)
        {
            if (Image == null)
            {
                return;
            }

            var targetSize = Size ?? new Size(Image.Width, Image.Height);

            try
            {
                //var point = GetPosition(new Size((int)Editor.Width, (int)Editor.Height), targetSize);
                var destRect = new RectangleF(Position, targetSize);

                Editor.DrawImage(Image, destRect, Opacity);
            }
            catch { }
            finally
            {
                if (_disposeImages)
                {
                    Image.Dispose();
                }
            }
        }
Exemple #3
0
        public static void Draw(IEditableFrame G, Func <Point, Point> Transform = null)
        {
            GetIcon(Transform, out var icon, out var location);

            if (icon == null)
            {
                return;
            }

            try
            {
                G.DrawImage(new DrawingImage(icon), new Rectangle(location, icon.Size));
            }
            catch (ArgumentException) { }
        }