Esempio n. 1
0
        public override void DrawImage(GraphicsHandler graphics, RectangleF source, RectangleF destination)
        {
            var sourceRect = new sd.RectangleF(source.X, Control.Size.Height - source.Y - source.Height, source.Width, source.Height);
            var destRect   = graphics.TranslateView(destination.ToSD(), true, true);

            Control.Draw(destRect, sourceRect, NSCompositingOperation.SourceOver, 1, true, null);
        }
Esempio n. 2
0
        public override void DrawImage(GraphicsHandler graphics, RectangleF source, RectangleF destination)
        {
            var sourceRect = graphics.Translate(source.ToSD(), Control.Size.Height);
            var destRect   = graphics.TranslateView(destination.ToSD(), true, true);

            graphics.Control.ConcatCTM(new CGAffineTransform(1, 0, 0, -1, 0, graphics.ViewHeight));
            destRect.Y = graphics.ViewHeight - destRect.Y - destRect.Height;
            Control.Draw(destRect, sourceRect, NSCompositingOperation.SourceOver, 1);
        }
Esempio n. 3
0
        /*
         * public override void DrawImage (GraphicsHandler graphics, int x, int y)
         * {
         *      var nsimage = this.Control;
         *      var sourceRect = graphics.Translate(new SD.RectangleF(0, 0, nsimage.Size.Width, nsimage.Size.Height), nsimage.Size.Height);
         *      var destRect = graphics.TranslateView(new SD.RectangleF(x, y, nsimage.Size.Width, nsimage.Size.Height), false);
         *      nsimage.Draw(destRect, sourceRect, NSCompositingOperation.SourceOver, 1);
         * }
         *
         * public override void DrawImage (GraphicsHandler graphics, int x, int y, int width, int height)
         * {
         *      var nsimage = this.Control;
         *      var sourceRect = graphics.Translate(new SD.RectangleF(0, 0, nsimage.Size.Width, nsimage.Size.Height), nsimage.Size.Height);
         *      var destRect = graphics.TranslateView(new SD.RectangleF(x, y, width, height), false);
         *      nsimage.Draw(destRect, sourceRect, NSCompositingOperation.SourceOver, 1);
         * }
         */

        public override void DrawImage(GraphicsHandler graphics, Rectangle source, Rectangle destination)
        {
            var nsimage    = this.Control;
            var sourceRect = graphics.Translate(Generator.ConvertF(source), nsimage.Size.Height);
            var destRect   = graphics.TranslateView(Generator.ConvertF(destination), false);

            if (alpha)
            {
                nsimage.Draw(destRect, sourceRect, NSCompositingOperation.SourceOver, 1);
            }
            else
            {
                nsimage.Draw(destRect, sourceRect, NSCompositingOperation.Copy, 1);
            }
        }
Esempio n. 4
0
        public override void DrawImage(GraphicsHandler graphics, RectangleF source, RectangleF destination)
        {
            var sourceRect = graphics.Translate(source.ToSD(), Control.Size.Height);
            var destRect   = graphics.TranslateView(destination.ToSD(), true, true);

            graphics.FlipDrawing();
            destRect.Y = graphics.ViewHeight - destRect.Y - destRect.Height;
            if (alpha)
            {
                Control.Draw(destRect, sourceRect, NSCompositingOperation.SourceOver, 1);
            }
            else
            {
                Control.Draw(destRect, sourceRect, NSCompositingOperation.Copy, 1);
            }
        }