Esempio n. 1
0
        public override void Generate(ref Device device)
        {
            bounds = new System.Drawing.RectangleF(-30.0f, 0.0f, 60.0f, 30.0f);
              texture = Microsoft.DirectX.Direct3D.TextureLoader.FromFile(
                device,
                Environment.CurrentDirectory + "\\Texture\\SKY_BOX_EGYPT.BMP",
                0,
                0,
                1,
                Usage.None,
                Format.Unknown,
                Pool.Managed,
                Filter.None,
                Filter.None,
                System.Drawing.Color.Magenta.ToArgb());

              float yOffSet = bounds.Height / 2;
              vertices = new CustomVertex.PositionColoredTextured[4];
              vertices[0].Position = new Vector3(bounds.X, bounds.Y + yOffSet, -15.0f);
              vertices[0].Tu = 0.0f; vertices[0].Tv = 0.0f;
              vertices[0].Color = System.Drawing.Color.LightBlue.ToArgb();

              vertices[1].Position = new Vector3(bounds.X, bounds.Y - yOffSet, -15.0f);
              vertices[1].Color = System.Drawing.Color.White.ToArgb();
              vertices[1].Tu = 0.0f; vertices[1].Tv = 1.0f;

              vertices[2].Position = new Vector3(bounds.X + bounds.Width, bounds.Y + yOffSet, -15.0f);
              vertices[2].Color = System.Drawing.Color.LightBlue.ToArgb();
              vertices[2].Tu = 1.0f; vertices[2].Tv = 0.0f;

              vertices[3].Position = new Vector3(bounds.X + bounds.Width, bounds.Y - yOffSet, -15.0f);
              vertices[3].Color = System.Drawing.Color.White.ToArgb();
              vertices[3].Tu = 1.0f; vertices[3].Tv = 1.0f;
        }
Esempio n. 2
0
        public override void Draw(System.Drawing.RectangleF rect)
        {
            base.Draw(rect);

            var width = rect.Width / 2f - 1f;
            var addedRect = new System.Drawing.RectangleF(0, 0, width, rect.Height);
            var removedRect = new System.Drawing.RectangleF(rect.Width / 2f + 1f, 0, width, rect.Height);

            var context = UIGraphics.GetCurrentContext();
            context.SaveState();
            context.SetFillColor(UIColor.FromRGB(204, 255, 204).CGColor);
            context.AddPath(GraphicsUtil.MakeRoundedRectPath(addedRect, 5));
            context.FillPath();

            context.SetFillColor(UIColor.FromRGB(255, 221, 221).CGColor);
            context.AddPath(GraphicsUtil.MakeRoundedRectPath(removedRect, 5));
            context.FillPath();

            context.RestoreState();

            UIColor.FromRGB(57, 152, 57).SetColor();
            var stringRect = addedRect;
            stringRect.Y += 1f;
            string addedString = (Added == null) ? "-" : "+" + Added.Value;
            DrawString(addedString, stringRect, UIFont.SystemFontOfSize(12f), UILineBreakMode.TailTruncation, UITextAlignment.Center);

            UIColor.FromRGB(0xcc, 0x33, 0x33).SetColor();
            stringRect = removedRect;
            stringRect.Y += 1f;
            string removedString = (Removed == null) ? "-" : "-" + Removed.Value;
            DrawString(removedString, stringRect, UIFont.SystemFontOfSize(12f), UILineBreakMode.TailTruncation, UITextAlignment.Center);
        }
Esempio n. 3
0
 public override void ViewDidMoveToSuperview ()
 {
     Frame = new System.Drawing.RectangleF(0, 25, Superview.Bounds.Width, Superview.Bounds.Height - 60);
     AdjustSubviews();
     SetPositionOfDivider(Bounds.Width/3, 0);
     base.ViewDidMoveToSuperview ();
 }
        public override void Draw(CGRect rect)
        {
            base.Draw(rect);

            var context = UIGraphics.GetCurrentContext();

            var indicatorLength = rect.Size.Height / 3f;
            var halfLength = (indicatorLength / 2);

            context.SetFillColor(UIColor.Black.CGColor);
            context.SetStrokeColor(UIColor.White.CGColor);
            context.SetLineWidth(0.5f);
            context.SetShadow(new CGSize(0, 0), 4);

            var pos = rect.Width / 2f;

            context.MoveTo(pos - halfLength, -1);
            context.AddLineToPoint(pos + halfLength, -1);
            context.AddLineToPoint(pos, indicatorLength);
            context.AddLineToPoint(pos - halfLength, -1);

            context.MoveTo(pos - halfLength, rect.Size.Height + 1);
            context.AddLineToPoint(pos + halfLength, rect.Size.Height + 1);
            context.AddLineToPoint(pos, rect.Size.Height - indicatorLength);
            context.AddLineToPoint(pos - halfLength, rect.Size.Height + 1);

            context.ClosePath();
            context.DrawPath(CGPathDrawingMode.FillStroke);
        }
        public override void Draw(CGRect rect)
        {
            base.Draw(rect);

            var step = 1f / 6f;
            var locations = new nfloat[]
            {
                0.0f,
                step * 1f,
                step * 2f,
                step * 3f,
                step * 4f,
                step * 5f,
                1.0f
            };
            var colors = new CGColor[]
            {
                UIColor.Red.CGColor,
                new CGColor(1, 0, 1, 1),
                UIColor.Blue.CGColor,
                new CGColor(0, 1, 1, 1),
                UIColor.Green.CGColor,
                new CGColor(1, 1, 0, 1),
                UIColor.Red.CGColor
            };

            using (var colorSpace = CGColorSpace.CreateDeviceRGB())
            using (var gradiend = new CGGradient(colorSpace, colors, locations))
            {
                var context = UIGraphics.GetCurrentContext();
                context.DrawLinearGradient(gradiend, new CGPoint(rect.Size.Width, 0), new CGPoint(0, 0), CGGradientDrawingOptions.DrawsBeforeStartLocation);
            }
        }
Esempio n. 6
0
        protected override Rhino.Commands.Result RunCommand(Rhino.RhinoDoc doc, Rhino.Commands.RunMode mode)
        {
            MonoMac.ObjCRuntime.Runtime.RegisterAssembly (this.GetType ().Assembly);
              var vm = new DNViewModel();
              var win = RhinoMac.Window.FromNib("CocoaRhinoWindow", vm);

              win.Title = "On the fly";

              var rect = new System.Drawing.RectangleF(10, 100, 200, 50);
              //var btn = new MonoMac.AppKit.NSButton (rect);
              var btn = new CustomButton(rect);

              win.ContentView.AddSubview(btn);
              btn.Title = "On the fly";
              btn.SetButtonType(MonoMac.AppKit.NSButtonType.MomentaryLightButton);
              btn.BezelStyle = MonoMac.AppKit.NSBezelStyle.Rounded;
              TestResponer res = new TestResponer ();
              btn.Activated += (object sender, EventArgs e) => {
            MonoMac.AppKit.NSFontManager.SharedFontManager.Target = res;
            MonoMac.AppKit.NSFontManager.SharedFontManager.OrderFrontFontPanel (btn);
              };
              res.NextResponder = win.NextResponder;
              win.NextResponder = res;

              win.ShowModal();

              return Rhino.Commands.Result.Success;
        }
Esempio n. 7
0
 public MiniCell()
     : base(UITableViewCellStyle.Value1,Key)
 {
     Frame = new System.Drawing.RectangleF (0, 0, 320, 30);
     TextLabel.Font = UIFont.SystemFontOfSize (UIFont.SmallSystemFontSize + 2);
     DetailTextLabel.Font = UIFont.SystemFontOfSize (UIFont.SmallSystemFontSize + 2);
 }
Esempio n. 8
0
		public override void DrawRect (CGRect dirtyRect)
		{
			CGContext ctx = NSGraphicsContext.CurrentContext.GraphicsPort;

			//fill BackgroundColor
			ctx.SetFillColor (Backend.Frontend.BackgroundColor.ToCGColor ());
			ctx.FillRect (Bounds);
		}
Esempio n. 9
0
 public override void Draw(System.Drawing.Graphics g)
 {
     System.Drawing.SolidBrush solidBrush = new System.Drawing.SolidBrush(Color);
     System.Drawing.PointF upperLeftPoint = new System.Drawing.PointF((float)(Center.X - RadiusX), (float)(Center.Y - RadiusY));
     System.Drawing.SizeF rectSize = new System.Drawing.SizeF((float)(2 * RadiusX), (float)(2 * RadiusY));
     System.Drawing.RectangleF rect = new System.Drawing.RectangleF(upperLeftPoint, rectSize);
     g.FillEllipse(solidBrush, rect);
     solidBrush.Dispose();
 }
Esempio n. 10
0
        protected UIMapControlInputHandler(InputMode setInputMode, UIMapControl setUIMapControl)
        {
            mapUnitOrder = MapUnitOrder.None;
             IsSpanningRectangle = false;
             selectionRectangle = RectangleF.Empty;

             MapControl = setUIMapControl;
             InputMode = setInputMode;
        }
Esempio n. 11
0
 public override void Draw(System.Drawing.Graphics g)
 {
     System.Drawing.SolidBrush solidBrush = new System.Drawing.SolidBrush(Color);
     System.Drawing.PointF upperLeftPoint = new System.Drawing.PointF((float)(Center.X - Width / 2), (float)(Center.Y - Height / 2));
     System.Drawing.SizeF rectSize = new System.Drawing.SizeF((float)Width, (float)Height);
     System.Drawing.RectangleF rect = new System.Drawing.RectangleF(upperLeftPoint, rectSize);
     g.FillRectangle(solidBrush, rect);
     solidBrush.Dispose();
 }
Esempio n. 12
0
        public override double GetValue1()
        {
            rect1 = object1.Element.GetScreenBounds();
            rect2 = object2.Element.GetScreenBounds();

            Utility.Intersect(ref rect1, ref rect2, out rectInt);

            return rectInt.Area();
        }
 public static System.Drawing.RectangleF Rect(System.Drawing.Rectangle rect)
 {
     var new_rect = new System.Drawing.RectangleF();
     new_rect.X = rect.X;
     new_rect.Y = rect.Y;
     new_rect.Width = rect.Width;
     new_rect.Height = rect.Height;
     return new_rect;
 }
        /// <summary>
        /// 获取编辑器对象的宽度
        /// </summary>
        /// <returns></returns>
        //public float GetWidth()
        //{
        //    return Math.Abs(this.Left - this.Right);
        //}

        ///// <summary>
        ///// 获取编辑器对象的高度
        ///// </summary>
        ///// <returns></returns>
        //public float GetHeight()
        //{
        //    return Math.Abs(this.Top - this.Bottom);
        //}

        /// <summary>
        /// 矩形区域与形参中的区域是否重叠交叉
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="right"></param>
        /// <param name="bottom"></param>
        /// <returns></returns>
        public bool IsCross(float x,float y,float right,float bottom)
        {
            bool isCoross = false;

            System.Drawing.RectangleF srcRect = new System.Drawing.RectangleF(this.Left, this.Top, this.Width, this.Height);
            System.Drawing.RectangleF destRect = new System.Drawing.RectangleF(x, y, right, bottom);
            if (srcRect.IntersectsWith(destRect)) isCoross = true;

            return isCoross;
        }
Esempio n. 15
0
 public void TestCreateSVGObject()
 {
     System.Drawing.RectangleF rect = new System.Drawing.RectangleF(); ;
     string lineBrush = null;
     string fillBrush = null;
     string expectedString = null;
     string resultString = null;
     resultString = _unitUnderTest.CreateSVGObject(rect, lineBrush, fillBrush);
     Assert.AreEqual(expectedString, resultString, "CreateSVGObject method returned unexpected result.");
     Assert.Fail("Create or modify test(s).");
 }
		public DarkSwitch(bool on)
		{
			InsertSegment("ON", 0, false);
			InsertSegment("OFF", 1, false);
			Frame = new System.Drawing.RectangleF(0, 0, 100, 30);
			
			ControlStyle = UISegmentedControlStyle.Bar;
			BackgroundColor = StyleExtensions.transparent;
			TintColor = UIColor.FromRGB(100, 100, 100);
			
			SelectedSegment = (on) ? 0 : 1;
		}
		public override void LayoutSubviews ()
		{
			frameRect = Frame;
			frameRect.Location = new CGPoint (frameRect.Location.X + frameMargin, frameRect.Location.Y + 1.5f * frameMargin);
			frameRect.Size = new CGSize(frameRect.Size.Width - (frameRect.Location.X + frameMargin), frameRect.Size.Height - (frameRect.Location.Y + 1.5f * frameMargin));

			LoadAllowedTextsLabel ();

			LoadBarcode ();

			base.LayoutSubviews ();
		}
Esempio n. 18
0
        public static void Init(TestContext context)
        {
            dp1 = new System.Drawing.Point(10, 10);
            dp2 = new System.Drawing.Point(100, 100);
            drect = new System.Drawing.Rectangle(5, 5, 15, 15);

            wp1 = new System.Windows.Point(10, 10);
            wp2 = new System.Windows.Point(100, 100);
            wrect = new System.Windows.Rect(5, 5, 15, 15);

            fp1 = new System.Drawing.PointF(10, 10);
            fp2 = new System.Drawing.PointF(100, 100);
            frect = new System.Drawing.RectangleF(5, 5, 15, 15);
        }
Esempio n. 19
0
    /// <summary>
    /// Update the default bounds and margins after the printer settings changed.
    /// This function must be called manually after a page setup dialog.
    /// </summary>
    public void UpdateBoundsAndMargins()
    {
      if (_printerSettings.IsValid)
      {
        _printerPageBounds = _printDocument.DefaultPageSettings.Bounds;
        _printerMargins = _printDocument.DefaultPageSettings.Margins;
      }
      else // obviously no printer installed, use A4 size (sorry, this is european size)
      {
        _printerPageBounds = new System.Drawing.RectangleF(0, 0, 1169, 826);
        _printerMargins = new System.Drawing.Printing.Margins(50, 50, 50, 50);
      }

    }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            Title = "Gesture Recognizers";

            imgDragMe.Image = UIImage.FromBundle ("Images/DragMe.png");
            imgTapMe.Image = UIImage.FromBundle ("Images/DoubleTapMe.png");

            originalImageFrame = imgDragMe.Frame;

            WireUpTapGestureRecognizer ();
            WireUpDragGestureRecognizer ();
        }
        protected void HandleDrag(UIPanGestureRecognizer recognizer)
        {
            // if it's just began, cache the location of the image
            if (recognizer.State == UIGestureRecognizerState.Began)
                originalImageFrame = imgDragMe.Frame;

            if (recognizer.State != (UIGestureRecognizerState.Cancelled | UIGestureRecognizerState.Failed
                | UIGestureRecognizerState.Possible)) {

                // move the shape by adding the offset to the object's frame
                System.Drawing.PointF offset = recognizer.TranslationInView (imgDragMe);
                System.Drawing.RectangleF newFrame = originalImageFrame;
                newFrame.Offset (offset.X, offset.Y);
                imgDragMe.Frame = newFrame;
            }
        }
        public override void Draw(CGRect rect)
        {
            base.Draw(rect);

            nfloat margins = 4;
            var drawRect = new CGRect(rect.X + margins, rect.Y + margins, rect.Width - margins * 2, rect.Height - margins * 2);

            var context = UIGraphics.GetCurrentContext();
            context.AddEllipseInRect(drawRect);
            context.AddEllipseInRect(drawRect.Inset(4, 4));
            context.SetFillColor(UIColor.Black.CGColor);
            context.SetStrokeColor(UIColor.White.CGColor);
            context.SetLineWidth(0.5f);
            context.ClosePath();
            context.SetShadow(new CGSize(1, 2), 4);
            context.DrawPath(CGPathDrawingMode.EOFillStroke);
        }
Esempio n. 23
0
		public UITabBarControllerWithTabBarOnTop ()
		{
			//-----------------------CUSTOM TAB BAR-------------------------------------------------
			rect = new System.Drawing.RectangleF(0,0,this.View.Bounds.Size.Width,TAB_BAR_HEIGHT);
			this.TabBar.Frame = rect;
			this.TabBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;

			rect = new System.Drawing.RectangleF();
			rect.Location.Y = TAB_BAR_HEIGHT;
			rect.Size.Height = this.View.Bounds.Size.Height - TAB_BAR_HEIGHT;

			this.View.Frame = rect;
			this.View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
			//----------------------------------------------------------------------------------------

			tab1 = new UIViewController();
			tab1.Title = "Green";
			tab1.View.BackgroundColor = UIColor.Green;

			tab2 = new UIViewController();
			tab2.Title = "Orange";
			tab2.View.BackgroundColor = UIColor.Orange;

			tab3 = new UIViewController();
			tab3.Title = "Red";
			tab3.View.BackgroundColor = UIColor.Red;
			
			#region Additional Info
//			tab1.TabBarItem = new UITabBarItem (UITabBarSystemItem.History, 0); // sets image AND text
//			tab2.TabBarItem = new UITabBarItem ("Orange", UIImage.FromFile("Images/first.png"), 1);
//			tab3.TabBarItem = new UITabBarItem ();
//			tab3.TabBarItem.Image = UIImage.FromFile("Images/second.png");
//			tab3.TabBarItem.Title = "Rouge"; // this overrides tab3.Title set above
//			tab3.TabBarItem.BadgeValue = "4";
//			tab3.TabBarItem.Enabled = false;
			#endregion

			var tabs = new UIViewController[] {
				tab1, tab2, tab3
			};

			ViewControllers = tabs;

			SelectedViewController = tab2; // normally you would default to the left-most tab (ie. tab1)
		}
Esempio n. 24
0
        public SpinnerLayer(CGRect frame)
        {

            Frame = new CGRect(0.0f, 0.0f, frame.Height, frame.Height);
            var radius = (frame.Height / 2.0f) * 0.5f;
            var center = new CGPoint(frame.Height / 2.0f, Bounds.GetMidY());
            var startAngle = -(fPI / 2);
            var endAngle = fPI * 2.0f - (fPI / 2.0f);
            var clockwise = true;
            Path = UIBezierPath.FromArc(center, radius, startAngle, endAngle, clockwise).CGPath;

            FillColor = null;
            StrokeColor = UIColor.White.CGColor;
            LineWidth = 1.0f;

            StrokeEnd = 0.4f;
            Hidden = true;
        }
		public MainPageView (CGRect bounds)
		{
			header = new UILabel ();
			this.BackgroundColor = UIColor.FromRGB(49,173,225);
			this.Frame = new CGRect (0, 0, bounds.Width, bounds.Height);
			content =new UIView(new CGRect(0,0,this.Frame.Width,this.Frame.Height));
			background=new UIView(new CGRect(0,50,this.Frame.Width,this.Frame.Height+72));
			background.BackgroundColor = UIColor.White;
			setvalue1 (0);
			this.Add(background);
			background.Add(content);

			header.Frame =new CGRect ((bounds.Width/2)-100, 10, 200, 30);
			header.Text="Home";
			header.TextColor = UIColor.White;
			header.TextAlignment = UITextAlignment.Center;
			this.AddSubview (header);
		}
Esempio n. 26
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            Debug.WriteLine("Form1_Shown");

            surface = new Win32Surface(this.CreateGraphics().GetHdc());
            context = new Context(surface);

            textFormat = DWriteCairo.CreateTextFormat(
                "Consolas",
                FontWeight.Normal,
                FontStyle.Normal,
                FontStretch.Normal,
                12);

            textFormat.TextAlignment = TextAlignment.Center;
            
            float left, top, width, height;

            // get actual size of the text
            var measureLayout = DWriteCairo.CreateTextLayout(s, textFormat, 4096, 4096);
            measureLayout.GetRect(out left, out top, out width, out height);
            measureLayout.Dispose();

            // build text context against the size and format
            textLayout = DWriteCairo.CreateTextLayout(s, textFormat, (int)Math.Ceiling(width), (int)Math.Ceiling(height));

            Debug.WriteLine("showing layout");
            Path path = DWriteCairo.RenderLayoutToCairoPath(context, textLayout);
            context.AppendPath(path);
            context.Fill();

            textLayout.GetRect(out left, out top, out width, out height);
            textRect = new System.Drawing.RectangleF(left, top, width, height);
            context.Rectangle(left, top, width, height);
            context.Stroke();

            context.GetTarget().Flush();
        }
Esempio n. 27
0
        private byte[] RandomSymbol(int number)
        {
            number = number%360;
            string text ="";
            System.Drawing.Brush brush = null;
            if (number < 60)
                return null;
            if (number < 120)
            {
                text = "<120";
                brush = System.Drawing.Brushes.DarkGreen;
            }
            else if(number < 240)
            {
                text = number.ToString();
                brush = System.Drawing.Brushes.Orange;
            }
            else
            {
                text = ">240";
                brush = System.Drawing.Brushes.Red;
            }

            System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(120, 60);
            System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmp);
            System.Drawing.RectangleF size = new System.Drawing.RectangleF(0f, 0f, 120f, 60f);
            g.FillRectangle(System.Drawing.Brushes.White, size);
            var sf = new System.Drawing.StringFormat(System.Drawing.StringFormatFlags.NoWrap)
                         {Alignment = System.Drawing.StringAlignment.Center};

            g.DrawString(text, new System.Drawing.Font("Arial", 24), brush, size, sf);
            g.Flush();
            g.Dispose();
            var ms = new System.IO.MemoryStream();
            bmp.MakeTransparent(System.Drawing.Color.White);
            bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
            return ms.ToArray();
        }
Esempio n. 28
0
		/// <summary>
		/// Update the default bounds and margins after the printer settings changed.
		/// This function must be called manually after a page setup dialog.
		/// </summary>
		public void UpdateBoundsAndMargins()
		{
			bool validPage = false;

			if (_printerSettings.IsValid)
			{
				_printerPageBounds = _printDocument.DefaultPageSettings.Bounds;
				_printerMargins = _printDocument.DefaultPageSettings.Margins;

				// check the values
				validPage = true;
				validPage &= _printerPageBounds.Height > 0;
				validPage &= _printerPageBounds.Width > 0;
				validPage &= _printerPageBounds.Height > (_printerMargins.Top + _printerMargins.Bottom);
				validPage &= _printerPageBounds.Width > (_printerMargins.Left + _printerMargins.Right);
			}

			if (!validPage)// obviously no printer installed, use A4 size (sorry, this is european size)
			{
				_printerPageBounds = new System.Drawing.RectangleF(0, 0, 1169, 826);
				_printerMargins = new System.Drawing.Printing.Margins(50, 50, 50, 50);
			}
		}
Esempio n. 29
0
        public static void Init(TestContext context)
        {
            drect = new System.Drawing.Rectangle(5, 5, 5, 5);
            dr1 = new System.Drawing.Rectangle(6, 6, 1, 1); //In
            dr2 = new System.Drawing.Rectangle(3, 3, 5, 5); //Overlap TopLeft
            dr3 = new System.Drawing.Rectangle(0, 0, 15, 15); //Over
            dr4 = new System.Drawing.Rectangle(0, 0, 1, 1); //Out
            dr5 = new System.Drawing.Rectangle(8, 8, 5, 5); //Overlap RightBottom

            frect = new System.Drawing.RectangleF(5, 5, 5, 5);
            fr1 = new System.Drawing.RectangleF(6, 6, 1, 1); //In
            fr2 = new System.Drawing.RectangleF(3, 3, 5, 5); //Overlap TopLeft
            fr3 = new System.Drawing.RectangleF(0, 0, 15, 15); //Over
            fr4 = new System.Drawing.RectangleF(0, 0, 1, 1); //Out
            fr5 = new System.Drawing.RectangleF(8, 8, 5, 5); //Overlap RightBottom

            wrect = new System.Windows.Rect(5, 5, 5, 5);
            wr1 = new System.Windows.Rect(6, 6, 1, 1); //In
            wr2 = new System.Windows.Rect(3, 3, 5, 5); //Overlap TopLeft
            wr3 = new System.Windows.Rect(0, 0, 15, 15); //Over
            wr4 = new System.Windows.Rect(0, 0, 1, 1); //Out
            wr5 = new System.Windows.Rect(8, 8, 5, 5); //Overlap RightBottom
        }
Esempio n. 30
0
        public override void Generate(ref Device device)
        {
            worldMatrix = device.Transform.World;
              z = 0.0f;
              bounds = new System.Drawing.RectangleF(0.0f, 0.0f, 0.1f, 0.1f);
              texture = Microsoft.DirectX.Direct3D.TextureLoader.FromFile(
                device,
                Environment.CurrentDirectory + "\\Texture\\Cursor\\MOUSE_POINTER.BMP",
                0,
                0,
                1,
                Usage.None,
                Format.Unknown,
                Pool.Managed,
                Filter.None,
                Filter.None,
                System.Drawing.Color.Black.ToArgb());

              float yOffSet = bounds.Height / 2;
              vertices = new CustomVertex.PositionColoredTextured[4];
              vertices[0].Position = new Vector3(bounds.X, bounds.Y + yOffSet, z);
              vertices[0].Tu = 1.0f; vertices[0].Tv = 0.0f;
              vertices[0].Color = System.Drawing.Color.White.ToArgb();

              vertices[1].Position = new Vector3(bounds.X, bounds.Y - yOffSet, z);
              vertices[1].Tu = 1.0f; vertices[1].Tv = 1.0f;
              vertices[1].Color = System.Drawing.Color.White.ToArgb();

              vertices[2].Position = new Vector3(bounds.X + bounds.Width, bounds.Y + yOffSet, z);
              vertices[2].Tu = 0.0f; vertices[2].Tv = 0.0f;
              vertices[2].Color = System.Drawing.Color.White.ToArgb();

              vertices[3].Position = new Vector3(bounds.X + bounds.Width, bounds.Y - yOffSet, z);
              vertices[3].Tu = 0.0f; vertices[3].Tv = 1.0f;
              vertices[3].Color = System.Drawing.Color.White.ToArgb();
        }
Esempio n. 31
0
 /// <summary>Because we are NOT inverting our y axis, the properties "Top" and "Bottom" have misleading names.</summary>
 public static float YMax(this RectangleClass rect)
 => rect.Bottom;
Esempio n. 32
0
        private async Task <Stream> GetImageStreamInternal(SignatureImageFormat format, System.Drawing.SizeF scale, System.Drawing.RectangleF signatureBounds, System.Drawing.SizeF imageSize, float strokeWidth, Color strokeColor, Color backgroundColor)
        {
            Bitmap.CompressFormat bcf;
            if (format == SignatureImageFormat.Jpeg)
            {
                bcf = Bitmap.CompressFormat.Jpeg;
            }
            else if (format == SignatureImageFormat.Png)
            {
                bcf = Bitmap.CompressFormat.Png;
            }
            else
            {
                return(null);
            }

            var image = GetImageInternal(scale, signatureBounds, imageSize, strokeWidth, strokeColor, backgroundColor);

            if (image != null)
            {
                using (image)
                {
                    var stream = new MemoryStream();
                    var result = await image.CompressAsync(bcf, 100, stream);

                    image.Recycle();

                    if (result)
                    {
                        stream.Position = 0;
                        return(stream);
                    }
                }
            }

            return(null);
        }
Esempio n. 33
0
 public static System.Drawing.Rectangle Truncate(System.Drawing.RectangleF value)
 {
     throw null;
 }
Esempio n. 34
0
        public MathKeyboardView(Func <TLayout> layoutCtor, Action <TButton, EventHandler> registerPressed, System.Drawing.RectangleF bounds,
                                TButton leftBtn,
                                MathKeyboard <TButton, TLayout> numbers, TButton numbersBtn,
                                MathKeyboard <TButton, TLayout> operations, TButton operationsBtn,
                                MathKeyboard <TButton, TLayout> functions, TButton functionsBtn,
                                MathKeyboard <TButton, TLayout> letters, TButton lettersBtn,
                                TButton rightBtn)
        {
            //MathList = new Atoms.MathList();
            Tabs = new ReadOnlyCollection <MathKeyboard <TButton, TLayout> >(new[] { numbers, operations, functions, letters });
            foreach (var tab in Tabs)
            {
                tab.layout.Visible = false;
            }
            _currentTab                = numbers;
            _currentTab.Selected       = true;
            _currentTab.layout.Visible = true;

            registerPressed(leftBtn, delegate { leftPressed?.Invoke(this, EventArgs.Empty); });
            registerPressed(rightBtn, delegate { rightPressed?.Invoke(this, EventArgs.Empty); });

            registerPressed(numbersBtn, delegate { CurrentTab = NumbersTab; });
            registerPressed(operationsBtn, delegate { CurrentTab = OperationsTab; });
            registerPressed(functionsBtn, delegate { CurrentTab = FunctionsTab; });
            registerPressed(lettersBtn, delegate { CurrentTab = LettersTab; });
            layout = layoutCtor();
            layout.Add(leftBtn);
            layout.Add(numbersBtn);
            layout.Add(operationsBtn);
            layout.Add(functionsBtn);
            layout.Add(lettersBtn);
            layout.Add(rightBtn);
            foreach (var tab in Tabs)
            {
                layout.Add(tab.layout);
            }
            layout.Bounds = bounds;
        }
Esempio n. 35
0
 public override void EditWithFrame(System.Drawing.RectangleF aRect, NSView inView, NSText editor, MonoMac.Foundation.NSObject delegateObject, NSEvent theEvent)
 {
     base.EditWithFrame(aRect, inView, editor, delegateObject, theEvent);
 }
Esempio n. 36
0
 protected virtual void ArrangeBorder(RectangleF finalRect)
 {
     _outerBorderRect = new RectangleF(finalRect.Location, finalRect.Size);
 }
 public override void Draw(GraphicsWrapper g, int unitsUnification, System.Drawing.RectangleF clippingRectangle, float itemWidth, float itemMargin)
 {
     base.Draw(g, unitsUnification, clippingRectangle, itemWidth, itemMargin);
 }
Esempio n. 38
0
        // System.Drawing.Rectangle*

        public static SKRect ToSKRect(this System.Drawing.RectangleF rect)
        {
            return(new SKRect(rect.Left, rect.Top, rect.Right, rect.Bottom));
        }
Esempio n. 39
0
 public static float GetBaseline(this System.Drawing.RectangleF viewFrame)
 {
     return(0);
 }
Esempio n. 40
0
 public static System.Drawing.Rectangle Ceiling(System.Drawing.RectangleF value)
 {
     throw null;
 }
Esempio n. 41
0
 public static CGRect ToNS(this System.Drawing.RectangleF rect)
 {
     return(new CGRect(rect.X, rect.Y, rect.Width, rect.Height));
 }
Esempio n. 42
0
 public void Intersect(System.Drawing.RectangleF rect)
 {
 }
Esempio n. 43
0
 public static System.Drawing.RectangleF Inflate(System.Drawing.RectangleF rect, float x, float y)
 {
     throw null;
 }
Esempio n. 44
0
 public bool Contains(System.Drawing.RectangleF rect)
 {
     throw null;
 }
Esempio n. 45
0
 public bool HitTest(Rectangle rect, Vector2 localPoint)
 {
     return(rect.Contains(localPoint.X, localPoint.Y));
 }
 /// <summary>
 /// Converts the <see cref="System.Drawing.RectangleF"/> to the <see cref="DotImaging.Primitives2D.RectangleF"/>.
 /// </summary>
 /// <param name="rect"><see cref="System.Drawing.RectangleF"/></param>
 /// <returns><see cref="DotImaging.Primitives2D.RectangleF"/></returns>
 public static RectangleF ToRect(this System.Drawing.RectangleF rect)
 {
     return(new RectangleF(rect.X, rect.Y, rect.Width, rect.Height));
 }
Esempio n. 47
0
 protected virtual GraphicsPath CreateBorderRectPath(RectangleF innerBorderRect)
 {
     return(GraphicsPathHelper.CreateRoundedRectPath(innerBorderRect, (float)CornerRadius, (float)CornerRadius));
 }
Esempio n. 48
0
        public override bool ProcessCollision(LevelEngine level, System.Drawing.RectangleF intersect)
        {
            switch (this.Edges)
            {
            case XEdgeType.None: break;

            case XEdgeType.Bounce: {
                var sb = this.GetScreenBounds();

                if (level.Hero.DirectionX > 0)
                {
                    level.Hero.Bounds.X = sb.Left - level.Hero.Bounds.Width - (level.Hero.Bounds.Right - sb.Left);
                }
                else if (level.Hero.DirectionX < 0)
                {
                    level.Hero.Bounds.X = sb.Right + sb.Right - level.Hero.Bounds.Left;
                }
                else if (level.Hero.DirectionY > 0)
                {
                    level.Hero.Bounds.Y = sb.Top - level.Hero.Bounds.Height - (level.Hero.Bounds.Bottom - sb.Top);
                }
                else if (level.Hero.DirectionY < 0)
                {
                    level.Hero.Bounds.Y = sb.Bottom + sb.Bottom - level.Hero.Bounds.Top;
                }

                // change hero's direction
                level.Hero.Direction = level.Hero.Direction.Reverse();

                this.EnqueueEvent(level.Hero.Id + ":bounce");
            }; break;

            case XEdgeType.Stick: {
                var sb = this.GetScreenBounds();

                if (level.Hero.DirectionX > 0)
                {
                    level.Hero.Bounds.X = sb.Left - level.Hero.Bounds.Width;
                }
                else if (level.Hero.DirectionX < 0)
                {
                    level.Hero.Bounds.X = sb.Right;
                }
                else if (level.Hero.DirectionY > 0)
                {
                    level.Hero.Bounds.Y = sb.Top - level.Hero.Bounds.Height;
                }
                else if (level.Hero.DirectionY < 0)
                {
                    level.Hero.Bounds.Y = sb.Bottom;
                }

                level.Hero.Direction = Direction.VectorStop;

                this.EnqueueEvent(level.Hero.Id + ":stick");
            }; break;

            case XEdgeType.Teleport: break;
            }

            return(true);
        }
Esempio n. 49
0
 public OrientedRect(System.Drawing.RectangleF rect)
 {
     Matrix = new MATRIX(rect.Width, 0, 0, rect.Height, rect.X, rect.Y);
 }
Esempio n. 50
0
 public virtual bool ProcessCollision(LevelEngine level, System.Drawing.RectangleF intersect)
 {
     return(false);
 }
Esempio n. 51
0
 public override void DrawRect(System.Drawing.RectangleF dirtyRect)
 {
     NSColor.WindowBackground.Set();
     NSBezierPath.FillRect(dirtyRect);
 }
Esempio n. 52
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            PagerControlMain.Pages = 5;

            int pageCount = (int)PagerControlMain.Pages;

            scrolViewCheck                   = new UIScrollView(new CGRect(0, 0, 318, 367));
            scrolViewCheck.Center            = new CGPoint(View.Frame.Size.Width / 2, View.Frame.Size.Height / 2);
            scrolViewCheck.ScrollEnabled     = true;
            scrolViewCheck.PagingEnabled     = true;
            scrolViewCheck.Layer.BorderWidth = 2.0f;
            scrolViewCheck.Layer.BorderColor = UIColor.Black.CGColor;
            //UIView checkDetailView = new UIView(new CGRect(0,0,(scrolViewCheck.Frame.Width * 2),367));
            //checkDetailView.Center = new CGPoint(scrolViewCheck.Frame.Size.Width / 2, scrolViewCheck.Frame.Size.Height / 2);
            //checkDetailView.Layer.BorderWidth = 2.0f;
            //checkDetailView.Layer.BorderColor = UIColor.Black.CGColor;
            //scrolViewCheck.BackgroundColor = UIColor.Orange;

            int i = 0;

            for (i = 0; i < pageCount; i++)
            {
                UIStackView objUIStackView = new UIStackView();
                UILabel     label          = new UILabel();
                UILabel     label1         = new UILabel();
                UITextField txtRemark      = new UITextField();
                UIButton    btnSave        = new UIButton();
                btnSave.SetTitle("Save", UIControlState.Normal);
                btnSave.BackgroundColor     = UIColor.Blue;
                txtRemark.Layer.BorderWidth = 1.0f;

                label.Text  = "CheckPoint";
                label1.Text = "CheckDetails";


                System.Drawing.RectangleF rectangle = new System.Drawing.RectangleF();
                rectangle.X      = (float)((this.scrolViewCheck.Frame.Width * i) + 100);
                rectangle.Y      = 0;
                rectangle.Width  = (float)this.scrolViewCheck.Frame.Size.Width;
                rectangle.Height = (float)this.scrolViewCheck.Frame.Size.Height / 4;
                label.Frame      = rectangle;

                System.Drawing.RectangleF rectangle1 = new System.Drawing.RectangleF();
                rectangle1.X      = (float)((this.scrolViewCheck.Frame.Width * i) + 100);
                rectangle1.Y      = (float)(this.scrolViewCheck.Frame.Size.Height / 4) * 1;
                rectangle1.Width  = (float)this.scrolViewCheck.Frame.Size.Width;
                rectangle1.Height = (float)this.scrolViewCheck.Frame.Size.Height / 4;
                label1.Frame      = rectangle1;

                System.Drawing.RectangleF rectangle2 = new System.Drawing.RectangleF();
                rectangle2.X     = (float)((this.scrolViewCheck.Frame.Width * i) + 10);
                rectangle2.Y     = (float)(this.scrolViewCheck.Frame.Size.Height / 4) * 2;
                rectangle2.Width = (float)this.scrolViewCheck.Frame.Size.Width - 20;
                //rectangle2.Height = (float)this.scrolViewCheck.Frame.Size.Height / 3;
                rectangle2.Height = 60;
                txtRemark.Frame   = rectangle2;

                System.Drawing.RectangleF rectangle3 = new System.Drawing.RectangleF();
                rectangle3.X     = (float)((this.scrolViewCheck.Frame.Width * i) + 40);
                rectangle3.Y     = (float)(this.scrolViewCheck.Frame.Size.Height / 4) * 3;
                rectangle3.Width = (float)this.scrolViewCheck.Frame.Size.Width - 80;
                //rectangle2.Height = (float)this.scrolViewCheck.Frame.Size.Height / 3;
                rectangle3.Height = 40;
                btnSave.Frame     = rectangle3;

                this.scrolViewCheck.AddSubview(label);
                this.scrolViewCheck.AddSubview(label1);
                this.scrolViewCheck.AddSubview(txtRemark);
                this.scrolViewCheck.AddSubview(btnSave);
            }


            //this.PagerControlMain.Pages = pageCount;

            //scrolViewCheck.AddSubview(checkDetailView);
            scrolViewCheck.ContentSize = new System.Drawing.SizeF((float)(scrolViewCheck.Frame.Width * pageCount), (float)scrolViewCheck.Frame.Height);

            View.AddSubview(scrolViewCheck);
            this.scrolViewCheck.Scrolled += ScrolledEvent;
        }
Esempio n. 53
0
        public void Paint(IPlayerSkill skill, RectangleF rect)
        {
            if (skill == null)
            {
                return;
            }

            if (TextureOpacity > 0)
            {
                var texture = Hud.Texture.GetTexture(skill.SnoPower.NormalIconTextureId);
                if (texture != null)
                {
                    texture.Draw(rect.X, rect.Y, rect.Width, rect.Height, TextureOpacity);
                }
            }

            if (skill.IsOnCooldown && (skill.CooldownFinishTick > Hud.Game.CurrentGameTick))
            {
                var remaining = (skill.CooldownFinishTick - Hud.Game.CurrentGameTick) / 60.0d;
                var text      = remaining > 1.0f ? remaining.ToString("F0", CultureInfo.InvariantCulture) : remaining.ToString("F1", CultureInfo.InvariantCulture);

                var textLayout = CooldownFont.GetTextLayout(text, true);
                CooldownFont.DrawText(textLayout, rect.X + (rect.Width - (float)Math.Ceiling(textLayout.Metrics.Width)) / 2.0f, rect.Y + (rect.Height - textLayout.Metrics.Height) / 2);
            }

            if (!EnableSkillDpsBar || skill.SnoPower.ElementalDamageTypesByRune == null)
            {
                return;
            }

            var elite = Hud.Game.IsEliteOnScreen || Hud.Game.IsGoblinOnScreen;

            if (Hud.Game.IsInTown)
            {
                if (_lastTownEliteSimulation.TimerTest(3000))
                {
                    elite = true;
                    if (_lastTownEliteSimulation.TimerTest(6000))
                    {
                        _lastTownEliteSimulation.Restart();
                    }
                }
            }

            var rune = skill.Rune;

            if (rune == byte.MaxValue)
            {
                rune = 0;
            }
            else
            {
                rune += 1;
            }
            var elementalType = skill.ElementalType;

            if (elementalType == -1)
            {
                return;
            }

            var resourceCost           = skill.ResourceCost;
            var weaponDamageMultiplier = skill.WeaponDamageMultiplier;

            if (weaponDamageMultiplier != -1)
            {
                var dotSeconds = skill.DotSeconds;

                uint powerSno = skill.SnoPower.Sno;
                if (powerSno == 102573)
                {
                    powerSno = 109560;                     // summon zombie dogs fix
                }
                if (powerSno == 123208)
                {
                    powerSno = 362118;                     // mystic ally fix
                }
                var skillBonus     = 1 + skill.DamageBonus;
                var elementalBonus = 1 + skill.ElementalDamageBonus;
                var eliteBonus     = 1 + (elite ? Hud.Game.Me.Offense.BonusToElites : 0);

                var skillBonusTotal = skillBonus * elementalBonus * eliteBonus;

                double plainBonusTotal = 1;
                foreach (var bonus in Hud.Game.Me.Offense.PlainDamageBonuses)
                {
                    plainBonusTotal *= (1 + bonus.Item2);
                }

                var weaponDamage = Hud.Game.Me.Offense.MainHandIsActive ? Hud.Game.Me.Offense.WeaponDamageMainHand : Hud.Game.Me.Offense.WeaponDamageSecondHand;
                var attackSpeed  = Hud.Game.Me.Offense.MainHandIsActive ? Hud.Game.Me.Offense.AttackSpeedMainHand : Hud.Game.Me.Offense.AttackSpeedOffHand;

                var skillDamage = weaponDamage * (weaponDamageMultiplier / 100) * skillBonusTotal * plainBonusTotal;
                var skillDps    = skillDamage;
                if (dotSeconds > 0)
                {
                    skillDps /= dotSeconds;
                }
                else
                {
                    skillDps *= attackSpeed;
                }

                var textLayout = SkillDamageFont.GetTextLayout(BasePlugin.ValueToString(skillDamage, ValueFormat.LongNumber));
                SkillDamageFont.DrawText(textLayout, rect.Left, rect.Bottom - textLayout.Metrics.Height + 1);

                var b = rect.Bottom + (Hud.Window.Size.Height - rect.Bottom) / 4.0f;

                var r = new System.Drawing.RectangleF(rect.Left, b, rect.Width, Hud.Window.Size.Height - b);
                SkillDpsBackgroundBrushesByElementalType[elementalType].DrawRectangle(r);

                textLayout = SkillDpsFont.GetTextLayout(BasePlugin.ValueToString(skillDps, ValueFormat.LongNumber));
                SkillDpsFont.DrawText(textLayout, rect.Left + (rect.Width - textLayout.Metrics.Width) / 2, b + (Hud.Window.Size.Height - b - textLayout.Metrics.Height) / 2);

                if (skillBonusTotal > 1)
                {
                    var bonusFont = elite ? DamageBonusEliteFont : DamageBonusFont;
                    textLayout = bonusFont.GetTextLayout("+" + (skillBonusTotal * 100 - 100).ToString("F0") + "%");
                    bonusFont.DrawText(textLayout, rect.Left, rect.Top - 1);
                }

                if (EnableDetailedDpsHint && Hud.Window.CursorInsideRect(rect.Left, rect.Top, rect.Width, rect.Height))
                {
                    var plainBonusText = "";
                    var plainBonuses   = Hud.Game.Me.Offense.PlainDamageBonuses.ToList();
                    if (plainBonuses.Count > 0)
                    {
                        plainBonusText = "\nPLAIN BONUSES: +" + (plainBonusTotal * 100 - 100).ToString("F0", CultureInfo.InvariantCulture) + "%\n";
                        foreach (var bonus in plainBonuses)
                        {
                            plainBonusText += "\t" + (bonus.Item2 * 100).ToString("F0", CultureInfo.InvariantCulture) + "% " + bonus.Item1.Icons[0].TitleLocalized + "\n";
                        }
                    }

                    var hint =
                        "WEAPON DAMAGE: " + BasePlugin.ValueToString(weaponDamage, ValueFormat.LongNumber) + " (" + (Hud.Game.Me.Offense.MainHandIsActive ? "left" : "right") + " hand)\n" +
                        (Hud.Game.Me.Offense.MainHandIsActive ?
                         "\t" + (Hud.Game.Me.Offense.WeaponBaseDamageMinAmainHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxAmainHand / 2).ToString("F0", CultureInfo.InvariantCulture) + " (" + Hud.Game.Me.Offense.WeaponBaseDamageMinAmainHand.ToString("F0", CultureInfo.InvariantCulture) + "-" + Hud.Game.Me.Offense.WeaponBaseDamageMaxAmainHand.ToString("F0", CultureInfo.InvariantCulture) + ")\n" :
                         "\t" + (Hud.Game.Me.Offense.WeaponBaseDamageMinAoffHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxAoffHand / 2).ToString("F0", CultureInfo.InvariantCulture) + " (" + Hud.Game.Me.Offense.WeaponBaseDamageMinAoffHand.ToString("F0", CultureInfo.InvariantCulture) + "-" + Hud.Game.Me.Offense.WeaponBaseDamageMaxAoffHand.ToString("F0", CultureInfo.InvariantCulture) + ")\n") +
                        (((Hud.Game.Me.Offense.DamageMin > 0) || (Hud.Game.Me.Offense.DamageMax > 0)) ?
                         ((Hud.Game.Me.Offense.DamageMin > 0) || (Hud.Game.Me.Offense.DamageMax > 0) ? "\t+ damage from armor: " + Hud.Game.Me.Offense.DamageMin.ToString("F0", CultureInfo.InvariantCulture) + "-" + Hud.Game.Me.Offense.DamageMax.ToString("F0", CultureInfo.InvariantCulture) + "\n" : "") +
                         (Hud.Game.Me.Offense.MainHandIsActive ?
                          "\t= " + (Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand / 2).ToString("F0", CultureInfo.InvariantCulture) + " (" + Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand.ToString("F0", CultureInfo.InvariantCulture) + "-" + Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand.ToString("F0", CultureInfo.InvariantCulture) + ")\n" :
                          "\t= " + (Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand / 2).ToString("F0", CultureInfo.InvariantCulture) + " (" + Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand.ToString("F0", CultureInfo.InvariantCulture) + "-" + Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand.ToString("F0", CultureInfo.InvariantCulture) + ")\n")
                        : "") +
                        "\tincreased by main stat: " +
                        (Hud.Game.Me.Offense.MainHandIsActive ?
                         "" + BasePlugin.ValueToString((Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand / 2) * (1 + Hud.Game.Me.Stats.MainStat / 100), ValueFormat.LongNumber) + " (" + BasePlugin.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand * (1 + Hud.Game.Me.Stats.MainStat / 100), ValueFormat.LongNumber) + "-" + BasePlugin.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand * (1 + Hud.Game.Me.Stats.MainStat / 100), ValueFormat.LongNumber) + ")\n" :
                         "" + BasePlugin.ValueToString((Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand / 2) * (1 + Hud.Game.Me.Stats.MainStat / 100), ValueFormat.LongNumber) + " (" + BasePlugin.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand * (1 + Hud.Game.Me.Stats.MainStat / 100), ValueFormat.LongNumber) + "-" + BasePlugin.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand * (1 + Hud.Game.Me.Stats.MainStat / 100), ValueFormat.LongNumber) + ")\n") +
                        "\tincreased by crit: " +
                        (Hud.Game.Me.Offense.MainHandIsActive ?
                         "" + BasePlugin.ValueToString((Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand / 2) * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100), ValueFormat.LongNumber) + " (" + BasePlugin.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100), ValueFormat.LongNumber) + "-" + BasePlugin.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100), ValueFormat.LongNumber) + ")\n" :
                         "" + BasePlugin.ValueToString((Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand / 2) * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100), ValueFormat.LongNumber) + " (" + BasePlugin.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100), ValueFormat.LongNumber) + "-" + BasePlugin.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100), ValueFormat.LongNumber) + ")\n") +
                        ((Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills > 0) ?
                         "\tincreased by skills: " +
                         (Hud.Game.Me.Offense.MainHandIsActive ?
                          "" + BasePlugin.ValueToString((Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand / 2) * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100) * (1 + Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills), ValueFormat.LongNumber) + " (" + BasePlugin.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100) * (1 + Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills), ValueFormat.LongNumber) + "-" + BasePlugin.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100) * (1 + Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills), ValueFormat.LongNumber) + ")\n" :
                          "" + BasePlugin.ValueToString((Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand / 2) * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100) * (1 + Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills), ValueFormat.LongNumber) + " (" + BasePlugin.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100) * (1 + Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills), ValueFormat.LongNumber) + "-" + BasePlugin.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100) * (1 + Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills), ValueFormat.LongNumber) + ")\n")
                        : "") +
                        "\nTOTAL BONUS: +" + (skillBonusTotal * 100 - 100).ToString("F0", CultureInfo.InvariantCulture) + "%\n" +
                        "\t" + (skill.ElementalDamageBonus * 100).ToString("F0", CultureInfo.InvariantCulture) + "% elemental\n" +
                        "\t" + (skill.DamageBonus * 100).ToString("F0", CultureInfo.InvariantCulture) + "% skill\n" +
                        (elite ? "\t" + (Hud.Game.Me.Offense.BonusToElites * 100).ToString("F0", CultureInfo.InvariantCulture) + "% elite\n" : "") +
                        plainBonusText +
                        "\n'" + skill.SnoPower.NameLocalized + "' / '" + skill.RuneNameLocalized + "' does " + weaponDamageMultiplier.ToString("F0", CultureInfo.InvariantCulture) + "% weapon damage" + (dotSeconds > 0 ? " over " + dotSeconds.ToString("F1", CultureInfo.InvariantCulture) + " seconds" : "") + "\n" +
                        "\tDMG: " + BasePlugin.ValueToString(skillDamage, ValueFormat.LongNumber) + " (= " + BasePlugin.ValueToString(weaponDamage, ValueFormat.LongNumber) + " * " + (weaponDamageMultiplier.ToString("F0", CultureInfo.InvariantCulture)) + "% + " + (skillBonusTotal * 100 - 100).ToString("F0", CultureInfo.InvariantCulture) + "% + " + (plainBonusTotal * 100 - 100).ToString("F0", CultureInfo.InvariantCulture) + "%)\n" +
                        "\tDPS: " + BasePlugin.ValueToString(skillDps, ValueFormat.LongNumber) + " (= " + BasePlugin.ValueToString(skillDamage, ValueFormat.LongNumber) + (dotSeconds > 0 ? " / " + dotSeconds.ToString("F1", CultureInfo.InvariantCulture) + " seconds" : " * " + attackSpeed.ToString("F2", CultureInfo.InvariantCulture) + " attack/s") + ")" +
                        ((resourceCost != -1) ? "\n\nResource cost\n\tdefault: " + BasePlugin.ValueToString(Math.Abs(resourceCost), ValueFormat.NormalNumberNoDecimal) + " " + (resourceCost > 0 ? Hud.Game.Me.HeroClassDefinition.PrimaryResourceName : Hud.Game.Me.HeroClassDefinition.SecondaryResourceName) + "\n\treal: " + BasePlugin.ValueToString(skill.GetResourceRequirement(), ValueFormat.NormalNumber) + " " + (resourceCost > 0 ? Hud.Game.Me.HeroClassDefinition.PrimaryResourceName : Hud.Game.Me.HeroClassDefinition.SecondaryResourceName) : "");
                    Hud.Render.SetHint(hint, "tooltip-bottom-right");
                }
            }
            else
            {
                if (resourceCost != -1)
                {
                    if (Hud.Window.CursorInsideRect(rect.Left, rect.Top, rect.Width, rect.Height))
                    {
                        Hud.Render.SetHint("Resource cost\n\tdefault: " + BasePlugin.ValueToString(Math.Abs(resourceCost), ValueFormat.NormalNumberNoDecimal) + " " + (resourceCost > 0 ? Hud.Game.Me.HeroClassDefinition.PrimaryResourceName : Hud.Game.Me.HeroClassDefinition.SecondaryResourceName) + "\n\treal: " + BasePlugin.ValueToString(skill.GetResourceRequirement(), ValueFormat.NormalNumber) + " " + (resourceCost > 0 ? Hud.Game.Me.HeroClassDefinition.PrimaryResourceName : Hud.Game.Me.HeroClassDefinition.SecondaryResourceName), "tooltip-bottom-right");
                    }
                }
            }
        }
Esempio n. 54
0
 public override CGSize CellSizeForBounds(CGRect bounds)
 {
     return(CGSize.Empty);
 }
Esempio n. 55
0
 public EtoWindow(CGRect rect, NSWindowStyle style, NSBackingStore store, bool flag)
     : base(rect, style, store, flag)
 {
 }
Esempio n. 56
0
 public static void GetAscentDescentWidth(this RectangleClass rect, out float ascent, out float descent, out float width)
 {
     ascent  = rect.Bottom;
     width   = rect.Width;
     descent = -rect.Y;
 }
Esempio n. 57
0
        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            RectangleF printable = e.MarginBounds;

            // Since PrintDocument.OriginAtMargins = True, sets top-Left corner to (0,0)
            printable.X = 0;
            printable.Y = 0;

            // Draws the logo
            int logoSize = 70;

            e.Graphics.DrawImage(Properties.Resources.logo, printable.Right - logoSize, printable.Y, logoSize, logoSize);

            //////////////
            // Draws the main title and some text
            //////////////

            string title = "Advanced Printing sample";

            Font titleFont = new Font(Font.FontFamily, 30, System.Drawing.FontStyle.Regular);

            System.Drawing.SizeF stringSize = e.Graphics.MeasureString(title, titleFont);

            float nextY = printable.Top + logoSize / 2;

            e.Graphics.DrawString(title, titleFont, System.Drawing.Brushes.Blue, printable.Left + printable.Width / 2 - stringSize.Width / 2, nextY);

            int verticalOffset = 60;

            nextY += stringSize.Height + 20;

            Font textFont = new Font(Font.FontFamily, 12, System.Drawing.FontStyle.Regular);

            string text = "This sample demonstrates how to draw different views of the same model in the proper page area.";

            stringSize = e.Graphics.MeasureString(text, textFont);

            e.Graphics.DrawString(text, textFont, System.Drawing.Brushes.Black, new RectangleF(printable.X, nextY, printable.Width, printable.Height));

            nextY += stringSize.Height + verticalOffset;

            // Defines a margin
            int marginFromBorder = 5;

            // Draw the views
            if (comboBoxPrintMode.SelectedIndex == 0) // Vector
            {
                PrintPageVector(sender, e, ref nextY, verticalOffset, printable, marginFromBorder);
            }
            else // Raster
            {
                PrintPageRaster(sender, e, ref nextY, verticalOffset, printable, marginFromBorder);
            }

            //////////////
            // Draws some other text
            //////////////

            Font   titleFont2 = new Font(Font.FontFamily, 20, System.Drawing.FontStyle.Bold);
            string title2     = "Window opening details";

            System.Drawing.SizeF title2Size = e.Graphics.MeasureString(title2, titleFont2);

            e.Graphics.DrawString(title2, titleFont2, System.Drawing.Brushes.Blue, printable.Left + printable.Width / 2 - title2Size.Width / 2, nextY + verticalOffset);

            nextY += 2 * (marginFromBorder + verticalOffset);

            text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";

            e.Graphics.DrawString(text, textFont, System.Drawing.Brushes.Black, new RectangleF(printable.Left, nextY, printable.Width / 2 - 20, printable.Height - nextY));
        }
Esempio n. 58
0
 public AnimatedShapeButton(CGRect frame)
     : base(frame)
 {
     Setup();
 }
Esempio n. 59
0
 public static System.Drawing.Rectangle Round(System.Drawing.RectangleF value)
 {
     throw null;
 }
Esempio n. 60
0
        private void CreateLayers(UIImage image)
        {
            if (image == null)
            {
                return;
            }

            Layer.Sublayers = new CALayer[0];

            var imageFrame = new CGRect(
                Frame.Width / 2f - Frame.Width / 4f,
                Frame.Height / 2f - Frame.Height / 4f,
                Frame.Width / 2f,
                Frame.Height / 2f);
            var imgCenterPoint = new CGPoint(imageFrame.GetMidX(), imageFrame.GetMidY());
            var lineFrame      = new CGRect(
                imageFrame.X - imageFrame.Width / 4f,
                imageFrame.Y - imageFrame.Height / 4f,
                imageFrame.Width * 1.5f,
                imageFrame.Height * 1.5f);

            //===============
            // circle layer
            //===============
            circleShape           = new CAShapeLayer();
            circleShape.Bounds    = imageFrame;
            circleShape.Position  = imgCenterPoint;
            circleShape.Path      = UIBezierPath.FromOval(imageFrame).CGPath;
            circleShape.FillColor = circleColor.CGColor;
            circleShape.Transform = CATransform3D.MakeScale(0.0f, 0.0f, 1.0f);
            Layer.AddSublayer(circleShape);

            circleMaskShape          = new CAShapeLayer();
            circleMaskShape.Bounds   = imageFrame;
            circleMaskShape.Position = imgCenterPoint;
            circleMaskShape.FillRule = CAShapeLayer.FillRuleEvenOdd;
            circleShape.Mask         = circleMaskShape;

            var maskPath = UIBezierPath.FromRect(imageFrame);

            maskPath.AddArc(imgCenterPoint, 0.1f, 0.0f, fPI * 2f, true);
            circleMaskShape.Path = maskPath.CGPath;

            //===============
            // line layer
            //===============
            lineShapes = new CAShapeLayer[5];
            for (int i = 0; i < 5; i++)
            {
                var line = new CAShapeLayer();
                line.Bounds        = lineFrame;
                line.Position      = imgCenterPoint;
                line.MasksToBounds = true;
                line.Actions       = NSDictionary.FromObjectsAndKeys(
                    new[] { NSNull.Null, NSNull.Null },
                    new[] { (NSString)"strokeStart", (NSString)"strokeEnd" });
                line.StrokeColor = linesColor.CGColor;
                line.LineWidth   = 1.25f;
                line.MiterLimit  = 1.25f;
                var path = new CGPath();
                path.MoveToPoint(lineFrame.GetMidX(), lineFrame.GetMidY());
                path.AddLineToPoint(lineFrame.X + lineFrame.Width / 2f, lineFrame.Y);
                line.Path        = path;
                line.LineCap     = CAShapeLayer.CapRound;
                line.LineJoin    = CAShapeLayer.JoinRound;
                line.StrokeStart = 0.0f;
                line.StrokeEnd   = 0.0f;
                line.Opacity     = 0.0f;
                line.Transform   = CATransform3D.MakeRotation(fPI / 5f * (i * 2f + 1f), 0.0f, 0.0f, 1.0f);
                Layer.AddSublayer(line);
                lineShapes[i] = line;
            }

            //===============
            // image layer
            //===============
            imageShape           = new CAShapeLayer();
            imageShape.Bounds    = imageFrame;
            imageShape.Position  = imgCenterPoint;
            imageShape.Path      = UIBezierPath.FromRect(imageFrame).CGPath;
            imageShape.FillColor = Checked ? Color.CGColor : SkeletonColor.CGColor;
            imageShape.Actions   = NSDictionary.FromObjectAndKey(NSNull.Null, (NSString)"fillColor");
            Layer.AddSublayer(imageShape);

            imageShape.Mask          = new CALayer();
            imageShape.Mask.Contents = image.CGImage;
            imageShape.Mask.Bounds   = imageFrame;
            imageShape.Mask.Position = imgCenterPoint;

            //==============================
            // circle transform animation
            //==============================
            circleTransform.Values = new[]
            {
                NSValue.FromCATransform3D(CATransform3D.MakeScale(0.0f, 0.0f, 1.0f)),      //  0/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(0.5f, 0.5f, 1.0f)),      //  1/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(1.0f, 1.0f, 1.0f)),      //  2/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(1.2f, 1.2f, 1.0f)),      //  3/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(1.3f, 1.3f, 1.0f)),      //  4/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(1.37f, 1.37f, 1.0f)),    //  5/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(1.4f, 1.4f, 1.0f)),      //  6/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(1.4f, 1.4f, 1.0f))       // 10/10
            };
            circleTransform.KeyTimes = new[]
            {
                NSNumber.FromDouble(0.0),    //  0/10
                NSNumber.FromDouble(0.1),    //  1/10
                NSNumber.FromDouble(0.2),    //  2/10
                NSNumber.FromDouble(0.3),    //  3/10
                NSNumber.FromDouble(0.4),    //  4/10
                NSNumber.FromDouble(0.5),    //  5/10
                NSNumber.FromDouble(0.6),    //  6/10
                NSNumber.FromDouble(1.0)     // 10/10
            };

            circleMaskTransform.Values = new[]
            {
                NSValue.FromCATransform3D(CATransform3D.Identity),                                                                 //  0/10
                NSValue.FromCATransform3D(CATransform3D.Identity),                                                                 //  2/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(imageFrame.Width * 1.25f, imageFrame.Height * 1.25f, 1.0f)),     //  3/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(imageFrame.Width * 2.688f, imageFrame.Height * 2.688f, 1.0f)),   //  4/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(imageFrame.Width * 3.923f, imageFrame.Height * 3.923f, 1.0f)),   //  5/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(imageFrame.Width * 4.375f, imageFrame.Height * 4.375f, 1.0f)),   //  6/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(imageFrame.Width * 4.731f, imageFrame.Height * 4.731f, 1.0f)),   //  7/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(imageFrame.Width * 5.0f, imageFrame.Height * 5.0f, 1.0f)),       //  9/10
                NSValue.FromCATransform3D(CATransform3D.MakeScale(imageFrame.Width * 5.0f, imageFrame.Height * 5.0f, 1.0f))        // 10/10
            };
            circleMaskTransform.KeyTimes = new[]
            {
                NSNumber.FromDouble(0.0),    //  0/10
                NSNumber.FromDouble(0.2),    //  2/10
                NSNumber.FromDouble(0.3),    //  3/10
                NSNumber.FromDouble(0.4),    //  4/10
                NSNumber.FromDouble(0.5),    //  5/10
                NSNumber.FromDouble(0.6),    //  6/10
                NSNumber.FromDouble(0.7),    //  7/10
                NSNumber.FromDouble(0.9),    //  9/10
                NSNumber.FromDouble(1.0)     // 10/10
            };

            //==============================
            // line stroke animation
            //==============================
            lineStrokeStart.Values = new[]
            {
                NSNumber.FromDouble(0.0),    //  0/18
                NSNumber.FromDouble(0.0),    //  1/18
                NSNumber.FromDouble(0.18),   //  2/18
                NSNumber.FromDouble(0.2),    //  3/18
                NSNumber.FromDouble(0.26),   //  4/18
                NSNumber.FromDouble(0.32),   //  5/18
                NSNumber.FromDouble(0.4),    //  6/18
                NSNumber.FromDouble(0.6),    //  7/18
                NSNumber.FromDouble(0.71),   //  8/18
                NSNumber.FromDouble(0.89),   // 17/18
                NSNumber.FromDouble(0.92)    // 18/18
            };
            lineStrokeStart.KeyTimes = new[]
            {
                NSNumber.FromDouble(0.0),    //  0/18
                NSNumber.FromDouble(0.056),  //  1/18
                NSNumber.FromDouble(0.111),  //  2/18
                NSNumber.FromDouble(0.167),  //  3/18
                NSNumber.FromDouble(0.222),  //  4/18
                NSNumber.FromDouble(0.278),  //  5/18
                NSNumber.FromDouble(0.333),  //  6/18
                NSNumber.FromDouble(0.389),  //  7/18
                NSNumber.FromDouble(0.444),  //  8/18
                NSNumber.FromDouble(0.944),  // 17/18
                NSNumber.FromDouble(1.0),    // 18/18
            };

            lineStrokeEnd.Values = new[]
            {
                NSNumber.FromDouble(0.0),    //  0/18
                NSNumber.FromDouble(0.0),    //  1/18
                NSNumber.FromDouble(0.32),   //  2/18
                NSNumber.FromDouble(0.48),   //  3/18
                NSNumber.FromDouble(0.64),   //  4/18
                NSNumber.FromDouble(0.68),   //  5/18
                NSNumber.FromDouble(0.92),   // 17/18
                NSNumber.FromDouble(0.92)    // 18/18
            };
            lineStrokeEnd.KeyTimes = new[]
            {
                NSNumber.FromDouble(0.0),    //  0/18
                NSNumber.FromDouble(0.056),  //  1/18
                NSNumber.FromDouble(0.111),  //  2/18
                NSNumber.FromDouble(0.167),  //  3/18
                NSNumber.FromDouble(0.222),  //  4/18
                NSNumber.FromDouble(0.278),  //  5/18
                NSNumber.FromDouble(0.944),  // 17/18
                NSNumber.FromDouble(1.0),    // 18/18
            };

            lineOpacity.Values = new[]
            {
                NSNumber.FromDouble(1.0),    //  0/30
                NSNumber.FromDouble(1.0),    // 12/30
                NSNumber.FromDouble(0.0)     // 17/30
            };
            lineOpacity.KeyTimes = new[]
            {
                NSNumber.FromDouble(0.0),    //  0/30
                NSNumber.FromDouble(0.4),    // 12/30
                NSNumber.FromDouble(0.567)   // 17/30
            };

            //==============================
            // image transform animation
            //==============================
            imageTransform.Values = new[]
            {
                NSValue.FromCATransform3D(CATransform3D.MakeScale(0.0f, 0.0f, 1.0f)),      //  0/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(0.0f, 0.0f, 1.0f)),      //  3/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(1.2f, 1.2f, 1.0f)),      //  9/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(1.25f, 1.25f, 1.0f)),    // 10/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(1.2f, 1.2f, 1.0f)),      // 11/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(0.9f, 0.9f, 1.0f)),      // 14/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(0.875f, 0.875f, 1.0f)),  // 15/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(0.875f, 0.875f, 1.0f)),  // 16/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(0.9f, 0.9f, 1.0f)),      // 17/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(1.013f, 1.013f, 1.0f)),  // 20/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(1.025f, 1.025f, 1.0f)),  // 21/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(1.013f, 1.013f, 1.0f)),  // 22/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(0.96f, 0.96f, 1.0f)),    // 25/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(0.95f, 0.95f, 1.0f)),    // 26/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(0.96f, 0.96f, 1.0f)),    // 27/30
                NSValue.FromCATransform3D(CATransform3D.MakeScale(0.99f, 0.99f, 1.0f)),    // 29/30
                NSValue.FromCATransform3D(CATransform3D.Identity)                          // 30/30
            };
            imageTransform.KeyTimes = new[]
            {
                NSNumber.FromDouble(0.0),    //  0/30
                NSNumber.FromDouble(0.1),    //  3/30
                NSNumber.FromDouble(0.3),    //  9/30
                NSNumber.FromDouble(0.333),  // 10/30
                NSNumber.FromDouble(0.367),  // 11/30
                NSNumber.FromDouble(0.467),  // 14/30
                NSNumber.FromDouble(0.5),    // 15/30
                NSNumber.FromDouble(0.533),  // 16/30
                NSNumber.FromDouble(0.567),  // 17/30
                NSNumber.FromDouble(0.667),  // 20/30
                NSNumber.FromDouble(0.7),    // 21/30
                NSNumber.FromDouble(0.733),  // 22/30
                NSNumber.FromDouble(0.833),  // 25/30
                NSNumber.FromDouble(0.867),  // 26/30
                NSNumber.FromDouble(0.9),    // 27/30
                NSNumber.FromDouble(0.967),  // 29/30
                NSNumber.FromDouble(1.0)     // 30/30
            };

            // re-set the durations
            Duration = duration;
        }