示例#1
2
 public Point AddPoint(float value, DateTime timestamp)
 {
     var p = new Point(value, timestamp);
     _points.Add(p);
     _lastPoint = p;
     return p;
 }
示例#2
1
        public Unit(IEnumerable<Point> members, Point pivot)
        {
            Displacements = new PointF[6][];
            var pivotF = pivot.ToGeometry();
            Displacements[0] = members.Select(z => z.ToGeometry().Sub(pivotF)).ToArray();
            Array.Sort(Displacements[0], pointsComparer);
            Period = 6;

            for (int i = 1; i < 6; i++)
            {
                Displacements[i] = Displacements[i - 1]
                    .Select(z => z.Rotate(new Point(0, 0), angle))
                    .ToArray();
                Array.Sort(Displacements[i], pointsComparer);
                if (Displacements[i].Zip(Displacements[0], (p1, p2) => Math.Abs(p1.X - p2.X) + Math.Abs(p1.Y - p2.Y) < 1e-3).All(a => a))
                {
                    Period = i;
                    break;
                }
            }

            IsLine = Displacements
                .Where(z => z != null)
                .Any(z => z.All(x => Math.Abs(x.Y-z[0].Y)<1e-5));
            IsLine = IsLine && members.Count() > 1;
        }
示例#3
1
        public AboutBox()
        {
            InitializeComponent();
            loc = label1.Location;

            label1.Text = "";
            try
            {
                var rm = new System.Resources.ResourceManager("BizHawk.Client.EmuHawk.Properties.Resources", GetType().Assembly);
                sfx = new SoundPlayer(rm.GetStream("nothawk"));
                sfx.Play();
            }
            catch
            {
            }

            //panel1.Size = new System.Drawing.Size(1000, 1000);
            //pictureBox5.GetType().GetMethod("SetStyle", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.InvokeMethod).Invoke(pictureBox5, new object[] { ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true });
            pictureBox5.BackColor = Color.Transparent;
            pictureBox5.SendToBack();
            pictureBox3.BringToFront();
            pictureBox2.BringToFront();
            pictureBox1.BringToFront();
            pictureBox5.Visible = false;
        }
示例#4
1
		public static Point TranslatePoint(Point point1, Point point2, Point point3, double angle)
		{
			var angle1 = Math.Atan2(point1.Y - point2.Y, point1.X - point2.X);
			var angle2 = angle1 - angle / AngleConvert;
			var length = (point3 - point2).Length;
			return new Point(point2.X + length * Math.Cos(angle2), point2.Y + length * Math.Sin(angle2));
		}
示例#5
1
	public static int Main ()
	{
		new Point {
			X = 0,
			Y = 0
		};
		
		var markerPosition = new Point {
			X = 2 * 3,
			Y = 9
		};
		
		if (markerPosition.X != 6)
			return 1;
		
		if (markerPosition.Y != 9)
			return 2;
		
		Point[] pa = new Point[] { new Point { X = 9 }, new Point { X = 8 } };
		
		if (pa [0].X != 9)
			return 3;
		
		if (pa [1].X != 8)
			return 3;

		p = new Point { Y = -1 };
		if (p.Y != -1)
			return 4;
		
		return 0;
	}
示例#6
1
文件: MainForm.cs 项目: mono/gert
	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Location = new Point (8, 8);
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. The background color of the Form is blue and does not show " +
			"any distortions.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (330, 120);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #81721";
	}
示例#7
1
 public Texte(string message, Point position, Color couleur)
 {
     this.message = message;
     this.position = position;
     this.couleur = couleur;
     this.police = Fonte.Arial15;
 }
示例#8
1
        public RespawnInfo(BinaryReader reader, int Version, int Customversion)
        {
            MonsterIndex = reader.ReadInt32();

            Location = new Point(reader.ReadInt32(), reader.ReadInt32());

            Count = reader.ReadUInt16();
            Spread = reader.ReadUInt16();

            Delay = reader.ReadUInt16();
            Direction = reader.ReadByte();

            if (Envir.LoadVersion >= 36)
            {
                RoutePath = reader.ReadString();
            }

            if (Version > 67)
            {
                RandomDelay = reader.ReadUInt16();
                RespawnIndex = reader.ReadInt32();
                SaveRespawnTime = reader.ReadBoolean();
                RespawnTicks = reader.ReadUInt16();
            }
            else
            {
                RespawnIndex = ++SMain.Envir.RespawnIndex;
            }
        }
		protected virtual void SetLocation()
		{
			TextArea textArea = control.ActiveTextAreaControl.TextArea;
			TextLocation caretPos  = textArea.Caret.Position;
			
			int xpos = textArea.TextView.GetDrawingXPos(caretPos.Y, caretPos.X);
			int rulerHeight = textArea.TextEditorProperties.ShowHorizontalRuler ? textArea.TextView.FontHeight : 0;
			Point pos = new Point(textArea.TextView.DrawingPosition.X + xpos,
			                      textArea.TextView.DrawingPosition.Y + (textArea.Document.GetVisibleLine(caretPos.Y)) * textArea.TextView.FontHeight
			                      - textArea.TextView.TextArea.VirtualTop.Y + textArea.TextView.FontHeight + rulerHeight);
			
			Point location = control.ActiveTextAreaControl.PointToScreen(pos);
			
			// set bounds
			Rectangle bounds = new Rectangle(location, drawingSize);
			
			if (!workingScreen.Contains(bounds)) {
				if (bounds.Right > workingScreen.Right) {
					bounds.X = workingScreen.Right - bounds.Width;
				}
				if (bounds.Left < workingScreen.Left) {
					bounds.X = workingScreen.Left;
				}
				if (bounds.Top < workingScreen.Top) {
					bounds.Y = workingScreen.Top;
				}
				if (bounds.Bottom > workingScreen.Bottom) {
					bounds.Y = bounds.Y - bounds.Height - control.ActiveTextAreaControl.TextArea.TextView.FontHeight;
					if (bounds.Bottom > workingScreen.Bottom) {
						bounds.Y = workingScreen.Bottom - bounds.Height;
					}
				}
			}
			Bounds = bounds;
		}
 protected override void OnMouseDown(MouseEventArgs e)
 {
     _startPoint = e.Location;
     _hscrolloffset = LayoutTarget.HorizontalScroll.Value;
     _vscrolloffset = LayoutTarget.VerticalScroll.Value;
     base.OnMouseDown(e);
 }
示例#11
1
 public override void Draw(SpriteBatchUI spriteBatch, Point position)
 {
     Vector3 hueVector = Utility.GetHueVector(Hue);
     int width = (int)(m_PercentWidthDrawn * Width);
     spriteBatch.Draw2D(m_Texture, new Rectangle(position.X, position.Y, width, Height), new Rectangle(0, 0, width, Height), hueVector);
     base.Draw(spriteBatch, position);
 }
        public void Move(Point newLocation)
        {
            if (newLocation == null)
                throw new ArgumentNullException(nameof(newLocation), "The new location is null!");

            Move(newLocation.X, newLocation.Y);
        }
示例#13
1
 protected Item(Image image, Image imageEffect, Sound soundEffect, Point initialPosition)
     : base(image, Rectangle.FromCenter(initialPosition, Size.Zero))
 {
     this.imageEffect = imageEffect;
     this.soundEffect = soundEffect;
     RenderLayer = MaxRenderLayer;
 }
示例#14
1
 public FIARECT(Point location, Size size)
 {
     this.left = location.X;
     this.top = location.Y;
     this.right = this.left + size.Width - 1;
     this.bottom = this.top + size.Height - 1;
 }
示例#15
1
 private void InvokeSurfacePressed(Point position)
 {
     if (this.SurfacePressed != null)
     {
         this.SurfacePressed.Invoke(this, new SurfacePressedEventArgs(position));
     }
 }
示例#16
1
 /// <summary>
 /// Compute the distance between the two point values
 /// </summary>
 /// <param name="source">The source point</param>
 /// <param name="target">The target point</param>
 /// <returns>the distance between the two provided points</returns>
 public static double Distance(this Point source, Point target)
 {
     return Math.Sqrt(
         (source.X - target.X) * (source.X - target.X) +
         (source.Y - target.Y) * (source.Y - target.Y)
         );
 }
        /// <summary>
        /// Rotate an image on a point with a specified angle
        /// </summary>
		/// <param name="pe">The paint area event where the image will be displayed</param>
		/// <param name="img">The image to display</param>
		/// <param name="alpha">The angle of rotation in radian</param>
		/// <param name="ptImg">The location of the left upper corner of the image to display in the paint area in nominal situation</param>
		/// <param name="ptRot">The location of the rotation point in the paint area</param>
		/// <param name="scaleFactor">Multiplication factor on the display image</param>
        protected void RotateImage(PaintEventArgs pe, Image img, Double alpha, Point ptImg, Point ptRot, float scaleFactor)
        {
            double beta = 0; 	// Angle between the Horizontal line and the line (Left upper corner - Rotation point)
            double d = 0;		// Distance between Left upper corner and Rotation point)		
            float deltaX = 0;	// X componant of the corrected translation
            float deltaY = 0;	// Y componant of the corrected translation

			// Compute the correction translation coeff
            if (ptImg != ptRot)
            {
				//
                if (ptRot.X != 0)
                {
                    beta = Math.Atan((double)ptRot.Y / (double)ptRot.X);
                }

                d = Math.Sqrt((ptRot.X * ptRot.X) + (ptRot.Y * ptRot.Y));

                // Computed offset
                deltaX = (float)(d * (Math.Cos(alpha - beta) - Math.Cos(alpha) * Math.Cos(alpha + beta) - Math.Sin(alpha) * Math.Sin(alpha + beta)));
                deltaY = (float)(d * (Math.Sin(beta - alpha) + Math.Sin(alpha) * Math.Cos(alpha + beta) - Math.Cos(alpha) * Math.Sin(alpha + beta)));
            }

            // Rotate image support
            pe.Graphics.RotateTransform((float)(alpha * 180 / Math.PI));

            // Dispay image
            pe.Graphics.DrawImage(img, (ptImg.X + deltaX) * scaleFactor, (ptImg.Y + deltaY) * scaleFactor, img.Width * scaleFactor, img.Height * scaleFactor);

            // Put image support as found
            pe.Graphics.RotateTransform((float)(-alpha * 180 / Math.PI));

        }
示例#18
1
 public static Point RtlTransform(Control control, Point point)
 {
     if (control.RightToLeft != RightToLeft.Yes)
         return point;
     else
         return new Point(control.Right - point.X, point.Y);
 }
示例#19
1
        public override void Execute(TextArea textArea)
        {
            Point position = textArea.Caret.Position;
            List<FoldMarker> foldings = textArea.Document.FoldingManager.GetFoldedFoldingsWithEnd(position.Y);
            FoldMarker justBeforeCaret = null;
            foreach (FoldMarker fm in foldings) {
                if (fm.EndColumn == position.X) {
                    justBeforeCaret = fm;
                    break; // the first folding found is the folding with the smallest Startposition
                }
            }

            if (justBeforeCaret != null) {
                position.Y = justBeforeCaret.StartLine;
                position.X = justBeforeCaret.StartColumn;
            } else {
                if (position.X > 0) {
                    --position.X;
                } else if (position.Y  > 0) {
                    LineSegment lineAbove = textArea.Document.GetLineSegment(position.Y - 1);
                    position = new Point(lineAbove.Length, position.Y - 1);
                }
            }

            textArea.Caret.Position = position;
            textArea.SetDesiredColumn();
        }
示例#20
1
 public static Point GetCursorPosition()
 {
     Point currentMousePoint;
     var gotPoint = GetCursorPos(out currentMousePoint);
     if (!gotPoint) { currentMousePoint = new Point(0, 0); }
     return currentMousePoint;
 }
示例#21
1
        //private Bitmap img = new Bitmap(Resources.GetBytes(Resources.BinaryResources.AnalogTicksOutside),
        //                                        Bitmap.BitmapImageType.Gif);
        //private Bitmap img = new Bitmap(Resources.GetBytes(Resources.BinaryResources.AnalogTicksInside),
        //                                        Bitmap.BitmapImageType.Gif);


        public override void Render(Bitmap screen)
        {
            if (_screen == null) _screen = screen;

            screen.DrawImage(0, 0, img, 0, 0, img.Width, img.Height);

            var text = "AGENT";
            Point textLocation = new Point(
                AGENT.Center.X - (drawing.MeasureString(text, smallFont) / 2), AGENT.Center.Y - 25);
            screen.DrawText(text, smallFont, Color.White, textLocation.X, textLocation.Y);

            var date = Settings.Now.ToString(CultureInfo.CurrentUICulture.DateTimeFormat.MonthDayPattern);
            ; //time.MonthNameShort + " " + time.Day;

            Point dateLocation = new Point(
                AGENT.Center.X - (drawing.MeasureString(date, smallFont) / 2), AGENT.Center.Y + 20);
            screen.DrawText(date, smallFont, Color.White, dateLocation.X, dateLocation.Y);

            //draw our hands
            drawing.PaintSkinnyHands(screen, Settings.Now, AGENT.Center);


            
            drawing.DrawTray(screen, _notificationProvider, smallFont);

        }
示例#22
1
 // -----------------------
 // Public Constructors
 // -----------------------
 /// <summary>
 ///	Rectangle Constructor
 /// </summary>
 ///
 /// <remarks>
 ///	Creates a Rectangle from Point and Size values.
 /// </remarks>
 public Rectangle(Point location, Size size)
 {
     x = location.X;
     y = location.Y;
     width = size.Width;
     height = size.Height;
 }
示例#23
1
 public Particle_SmokeStream(Vector2 position)
 {
     this.position = position;
     size = new Point(10, 10);
     color = Color.White;
     texture = Texture2DLibrary.particle_smoke;
 }
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="context"/>
		/// <param name="location"/>
		public InflAffixTemplateEventArgs(Control context, XmlNode node, Point location, int tag)
		{
			m_location = location;
			m_node = node;
			m_contextControl = context;
			m_tag = tag;
		}
 public void AddString(string s,	FontFamily family,	int style, float emSize, Point origin, StringFormat format)
 {
     var font = new Font (family.Name, emSize, (FontStyle)style);
     var layoutRect = RectangleF.Empty;
     layoutRect.Location = origin;
     NativeDrawString (s, font, Color.Red, layoutRect, format);
 }
示例#26
1
        internal TreeColumn GetColumnDividerAt(Point p)
        {
            if (p.Y > ColumnHeaderHeight)
                return null;

            int x = -OffsetX;
            TreeColumn prevCol = null;
            Rectangle left, right;
            foreach (TreeColumn col in Columns)
            {
                if (col.IsVisible)
                {
                    if (col.Width > 0)
                    {
                        left = new Rectangle(x, 0, DividerWidth / 2, ColumnHeaderHeight);
                        right = new Rectangle(x + col.Width - (DividerWidth / 2), 0, DividerWidth / 2, ColumnHeaderHeight);
                        if (left.Contains(p) && prevCol != null)
                            return prevCol;
                        else if (right.Contains(p))
                            return col;
                    }
                    prevCol = col;
                    x += col.Width;
                }
            }

            left = new Rectangle(x, 0, DividerWidth / 2, ColumnHeaderHeight);
            if (left.Contains(p) && prevCol != null)
                return prevCol;

            return null;
        }
示例#27
1
        void mouseZone_MouseMove(object sender, MouseEventArgs e)
        {
            if (IsActive)
            {
                _viewport.Cursor = Cursors.None;

                var centerOfViewport = _viewport.PointToScreen(new Point(_viewport.ActualWidth / 2, _viewport.ActualHeight / 2));
                var relativePos = e.MouseDevice.GetPosition(_viewport);
                var actualRelativePos = new Point(relativePos.X - _viewport.ActualWidth / 2, _viewport.ActualHeight / 2 - relativePos.Y);
                var dx = actualRelativePos.X;
                var dy = actualRelativePos.Y;
                _yaw += dx;
                _pitch += dy;
                
                // Rotate
                Rotation = QuaternionHelper.EulerAnglesInDegToQuaternion(_pitch * Sensitivity * 0.1, _yaw * Sensitivity * 0.1, 0);
                
                // Set mouse position back to the center of the viewport in screen coordinates
                MouseUtilities.SetPosition(centerOfViewport);
            }
            else
            {
                _viewport.Cursor = Cursors.Arrow;
            }
        }
 public static Point ScaleTo( Point value, Point source, Point dest )
 {
     return new Point(
         ScaleTo( value.X, source.X, dest.X ),
         ScaleTo( value.Y, source.Y, dest.Y )
         );
 }
示例#29
0
 public bool Equals(Point comparedCoord)
 {
     return (X == comparedCoord.X && Y == comparedCoord.Y);
 }
示例#30
0
 /// <summary>
 /// Compares two <see cref="Point"/> structures for equality.
 /// </summary>
 /// <param name="value">
 /// The point to compare to this instance.
 /// </param>
 /// <returns>
 /// true if both <see cref="Point"/> structures contain the same <see cref="X"/>
 /// and <see cref="Y"/> values; otherwise, false.
 /// </returns>
 public bool Equals(Point value)
 {
     return this == value;
 }
 public DLLPreviewComponent(Point aLocation, Size aSize, string aText, bool aUseText = false)
     : base(aLocation, aSize, aText)
 {
     myUseText = aUseText;
 }
示例#32
0
 /// <summary>
 /// Sets the PinPoint attached dependency property
 /// </summary>
 public static void SetCenter(DependencyObject obj, Point value)
 {
     obj.SetValue(CenterProperty, value);
 }
示例#33
0
 /// <summary>
 /// Sets the PinPoint attached dependency property
 /// </summary>
 public static void SetPinPoint(DependencyObject obj, Point value)
 {
     obj.SetValue(PinPointProperty, value);
 }
示例#34
0
 private void panel1_MouseUp(object sender, MouseEventArgs e)
 {
     last = Point.Empty;
 }
示例#35
0
 private void panel1_MouseDown(object sender, MouseEventArgs e)
 {
     last = Cursor.Position;
 }
示例#36
0
 protected abstract IDockContent HitTest(Point point);
示例#37
0
        private IDockContent HitTest()
        {
            Point ptMouse = PointToClient(Control.MousePosition);

            return(HitTest(ptMouse));
        }
示例#38
0
 public override bool MouseOver(Point p)
 {
     return(false);
 }
 private void Resize(Point p)
 {
     p = this.originalForm.PointToScreen(p);
     Screen screen = Screen.FromPoint(p);
     this.formRect = this.originalForm.Bounds;
     int right = this.formRect.Right;
     int bottom = this.formRect.Bottom;
     if ((this.resizeDirection & ResizeDir.Left) == ResizeDir.Left)
     {
         this.formRect.Width = (this.formRect.X - p.X) + this.formRect.Width;
         this.formRect.X = right - this.formRect.Width;
     }
     if ((this.resizeDirection & ResizeDir.Right) == ResizeDir.Right)
     {
         this.formRect.Width = p.X - this.formRect.Left;
     }
     if ((this.resizeDirection & ResizeDir.Top) == ResizeDir.Top)
     {
         this.formRect.Height = (this.formRect.Height - p.Y) + this.formRect.Top;
         this.formRect.Y = bottom - this.formRect.Height;
     }
     if ((this.resizeDirection & ResizeDir.Bottom) == ResizeDir.Bottom)
     {
         this.formRect.Height = p.Y - this.formRect.Top;
     }
     this.formOffsetRect.X = stickGap + 1;
     this.formOffsetRect.Y = stickGap + 1;
     this.formOffsetRect.Height = 0;
     this.formOffsetRect.Width = 0;
     if (this.stickToScreen)
     {
         this.Resize_Stick(screen.WorkingArea, false);
     }
     if (this.stickToOther)
     {
         foreach (Form form in GlobalStickyWindows)
         {
             if (form != this.originalForm)
             {
                 this.Resize_Stick(form.Bounds, true);
             }
         }
     }
     if (this.formOffsetRect.X == (stickGap + 1))
     {
         this.formOffsetRect.X = 0;
     }
     if (this.formOffsetRect.Width == (stickGap + 1))
     {
         this.formOffsetRect.Width = 0;
     }
     if (this.formOffsetRect.Y == (stickGap + 1))
     {
         this.formOffsetRect.Y = 0;
     }
     if (this.formOffsetRect.Height == (stickGap + 1))
     {
         this.formOffsetRect.Height = 0;
     }
     if ((this.resizeDirection & ResizeDir.Left) == ResizeDir.Left)
     {
         int num3 = (this.formRect.Width + this.formOffsetRect.Width) + this.formOffsetRect.X;
         if (this.originalForm.MaximumSize.Width != 0)
         {
             num3 = Math.Min(num3, this.originalForm.MaximumSize.Width);
         }
         num3 = Math.Max(Math.Max(Math.Min(num3, SystemInformation.MaxWindowTrackSize.Width), this.originalForm.MinimumSize.Width), SystemInformation.MinWindowTrackSize.Width);
         this.formRect.X = right - num3;
         this.formRect.Width = num3;
     }
     else
     {
         this.formRect.Width += this.formOffsetRect.Width + this.formOffsetRect.X;
     }
     if ((this.resizeDirection & ResizeDir.Top) == ResizeDir.Top)
     {
         int num4 = (this.formRect.Height + this.formOffsetRect.Height) + this.formOffsetRect.Y;
         if (this.originalForm.MaximumSize.Height != 0)
         {
             num4 = Math.Min(num4, this.originalForm.MaximumSize.Height);
         }
         num4 = Math.Max(Math.Max(Math.Min(num4, SystemInformation.MaxWindowTrackSize.Height), this.originalForm.MinimumSize.Height), SystemInformation.MinWindowTrackSize.Height);
         this.formRect.Y = bottom - num4;
         this.formRect.Height = num4;
     }
     else
     {
         this.formRect.Height += this.formOffsetRect.Height + this.formOffsetRect.Y;
     }
     this.originalForm.Bounds = this.formRect;
 }
示例#40
0
		public static Point ConvertContainer(ExporterCollection myList,ISimpleContainer container,int leftPos,Point curPos)
		{
			ExporterCollection ml = BaseConverter.ConvertItems (container, curPos);		
			myList.AddRange(ml);
			return new Point (leftPos,curPos.Y + container.Size.Height);
		}
示例#41
0
 public void Click(ScreenCanvas canvas, Point location)
 {
 }
示例#42
0
        private void InitializeComponent()
        {
            Point point2;

            icontainer_0 = new Container();
            vmethod_1(new Bar());
            vmethod_3(new LabelItem());
            vmethod_5(new ComboBoxItem());
            vmethod_7(new ButtonItem());
            vmethod_13(new ButtonItem());
            vmethod_9(new MetroStatusBar());
            vmethod_11(new LabelItem());
            vmethod_15(new LabelX());
            vmethod_17(new LabelX());
            vmethod_19(new LabelX());
            vmethod_21(new LabelX());
            vmethod_23(new LabelX());
            vmethod_25(new Timer(icontainer_0));
            vmethod_0().BeginInit();
            SuspendLayout();
            vmethod_0().AntiAlias = true;
            vmethod_0().Dock = DockStyle.Top;
            vmethod_0().Font = new Font("Segoe UI", 8.25F, FontStyle.Bold, GraphicsUnit.Point, 0);
            BaseItem[] baseItemArr = new BaseItem[] {
                                                      vmethod_2(), 
                                                      vmethod_4(), 
                                                      vmethod_6(), 
                                                      vmethod_12() };
            vmethod_0().Items.AddRange(baseItemArr);
            Point point1 = new Point(0, 0);
            vmethod_0().Location = point1;
            vmethod_0().Name = "Bar1";
            Size size = new Size(478, 27);
            vmethod_0().Size = size;
            vmethod_0().Stretch = true;
            vmethod_0().Style = eDotNetBarStyle.StyleManagerControlled;
            vmethod_0().TabIndex = 0;
            vmethod_0().TabStop = false;
            vmethod_0().Text = "Bar1";
            vmethod_2().Name = "lblSelectQuest";
            vmethod_2().PaddingLeft = 5;
            vmethod_2().Text = "SELECT QUEST";
            vmethod_4().ComboWidth = 110;
            vmethod_4().DropDownHeight = 106;
            vmethod_4().ItemHeight = 16;
            vmethod_4().Name = "cmbQuests";
            vmethod_6().ColorTable = eButtonColor.Blue;
            vmethod_6().Name = "btnSearch";
            vmethod_6().Text = "SEARCH QUEST";
            vmethod_12().ItemAlignment = eItemAlignment.Far;
            vmethod_12().Name = "btnClose";
            vmethod_12().Symbol = "";
            vmethod_12().SymbolSize = 10.0F;
            vmethod_8().BackgroundStyle.CornerType = eCornerType.Square;
            vmethod_8().ContainerControlProcessDialogKey = true;
            vmethod_8().Dock = DockStyle.Bottom;
            vmethod_8().Font = new Font("Segoe UI", 12.0F, FontStyle.Regular, GraphicsUnit.Point, 0);
            baseItemArr = new BaseItem[] { vmethod_10() };
            vmethod_8().Items.AddRange(baseItemArr);
            point1 = new Point(0, 348);
            vmethod_8().Location = point1;
            vmethod_8().Name = "statusBar";
            size = new Size(478, 26);
            vmethod_8().Size = size;
            vmethod_8().TabIndex = 1;
            vmethod_8().Text = "MetroStatusBar1";
            vmethod_10().Name = "questScanStatus";
            vmethod_10().PaddingTop = -4;
            vmethod_10().TextLineAlignment = StringAlignment.Near;
            vmethod_14().AutoSize = true;
            vmethod_14().BackgroundStyle.CornerType = eCornerType.Square;
            vmethod_14().Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 0);
            point1 = new Point(22, 84);
            vmethod_14().Location = point1;
            vmethod_14().Name = "conditionOne";
            size = new Size(0, 0);
            vmethod_14().Size = size;
            vmethod_14().TabIndex = 2;
            vmethod_16().AutoSize = true;
            vmethod_16().BackgroundStyle.CornerType = eCornerType.Square;
            vmethod_16().Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 0);
            point1 = new Point(22, 107);
            vmethod_16().Location = point1;
            vmethod_16().Name = "conditionTwo";
            size = new Size(0, 0);
            vmethod_16().Size = size;
            vmethod_16().TabIndex = 3;
            vmethod_18().AutoSize = true;
            vmethod_18().BackgroundStyle.CornerType = eCornerType.Square;
            vmethod_18().Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 0);
            point1 = new Point(22, 130);
            vmethod_18().Location = point1;
            vmethod_18().Name = "conditionThree";
            size = new Size(0, 0);
            vmethod_18().Size = size;
            vmethod_18().TabIndex = 4;
            vmethod_20().AutoSize = true;
            vmethod_20().BackgroundStyle.CornerType = eCornerType.Square;
            vmethod_20().Font = new Font("Segoe UI", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 0);
            point1 = new Point(22, 153);
            vmethod_20().Location = point1;
            vmethod_20().Name = "conditionFour";
            size = new Size(0, 0);
            vmethod_20().Size = size;
            vmethod_20().TabIndex = 5;
            vmethod_22().AutoSize = true;
            vmethod_22().BackgroundStyle.CornerType = eCornerType.Square;
            vmethod_22().Font = new Font("Segoe UI", 18.0F, FontStyle.Regular, GraphicsUnit.Point, 0);
            point1 = new Point(22, 52);
            vmethod_22().Location = point1;
            vmethod_22().Name = "questTitle";
            size = new Size(0, 0);
            vmethod_22().Size = size;
            vmethod_22().TabIndex = 6;
            SizeF sizeF = new SizeF(6.0F, 13.0F);
            AutoScaleDimensions = sizeF;
            AutoScaleMode = AutoScaleMode.Font;
            size = new Size(478, 374);
            ClientSize = size;
            Controls.Add(vmethod_22());
            Controls.Add(vmethod_20());
            Controls.Add(vmethod_18());
            Controls.Add(vmethod_16());
            Controls.Add(vmethod_14());
            Controls.Add(vmethod_8());
            Controls.Add(vmethod_0());
            DoubleBuffered = true;
            FormBorderStyle = FormBorderStyle.None;
            Name = "QuestForm";
            Text = "QuestForm";
            vmethod_0().EndInit();
            ResumeLayout(false);
            PerformLayout();
        }
示例#43
0
 public void Move(ScreenCanvas canvas, Point location)
 {
 }
 public WhitePiece(Point point) : base(point)
 {
     Image = Properties.Resources.white;
 }
示例#45
0
 public ImageFragment(IFragment original_fragment, Point position)
 {
     this.original_fragment = original_fragment;
     this.position          = position;
     this.replacement       = original_fragment;
 }
示例#46
0
        public void Release(ScreenCanvas canvas, Point location)
        {
            int tilePosX = location.X / canvas.Screen.Tileset.TileSize;

            canvas.Screen.CleaveVertically(tilePosX);
        }
示例#47
0
 public void AddPoint(Point p)
 {
     this.pointList.Add(new Point2d((int)p.X, (int)p.Y, pointList.Count));
     DrawPoint((int)p.X, (int)p.Y);
 }
		public ToolTipRequestEventArgs(Point mousePosition, TextLocation logicalPosition, bool inDocument)
		{
			this.mousePosition = mousePosition;
			this.logicalPosition = logicalPosition;
			this.inDocument = inDocument;
		}
示例#49
0
 public InteriorDoor(GameLocation location, Point position)
     : this()
 {
     Location = location;
     Position = position;
 }
示例#50
0
 public Rectangle(string name , double width , double height , double topLeftHoriz , double topLeftVert)
 {
     this.Name = name;
     this.TopLeft = new Point(topLeftHoriz, topLeftVert);
     this.BottomRight = new Point(topLeftHoriz + width , topLeftVert - height);
 }
        private async void OnBorderTapped(object sender, TappedRoutedEventArgs e)
        {
            if (_inAnimation)
            {
                return;
            }

            _inAnimation = true;
            _onBorderTappedCall++;
            var currentCall = _onBorderTappedCall;
            //var border = (Border)sender;
            //var grid = border.GetFirstAncestorOfType<UniformGrid>();

            //var sb = new Storyboard();

            //var beginTime = TimeSpan.Zero;

            //if (_isArrangedInGrid)
            //{
            //    var center = new Point(
            //        (grid.ActualWidth - border.ActualWidth) / 2,
            //        (grid.ActualHeight - border.ActualHeight) / 2);

            //    foreach (var child in grid.Children)
            //    {
            //        child.RenderTransform = new CompositeTransform();
            //        var nc = (NamedColor)((FrameworkElement)child).DataContext;
            //        var hsv = nc.Color.ToHsv();
            //        var targetX = center.X + center.X * Math.Sin(hsv.H * Math.PI / 180) * (0.25 + 0.75 * hsv.V);
            //        var targetY = center.Y - center.Y * Math.Cos(hsv.H * Math.PI / 180) * (0.25 + 0.75 * hsv.V);
            //        var actualPosition = child.TransformToVisual(grid).TransformPoint(new Point(0, 0));
            //        //Debug.WriteLine(actualPosition);
            //        var deltaX = targetX - actualPosition.X;
            //        var deltaY = targetY - actualPosition.Y;

            //        var xa = new DoubleAnimation();
            //        xa.BeginTime = beginTime;
            //        xa.Duration = TimeSpan.FromSeconds(1);
            //        xa.To = deltaX;
            //        Storyboard.SetTarget(xa, child.RenderTransform);
            //        Storyboard.SetTargetProperty(xa, "TranslateX");
            //        sb.Children.Add(xa);

            //        var ya = new DoubleAnimation();
            //        ya.BeginTime = beginTime;
            //        ya.Duration = TimeSpan.FromSeconds(1);
            //        ya.To = deltaY;
            //        Storyboard.SetTarget(ya, child.RenderTransform);
            //        Storyboard.SetTargetProperty(ya, "TranslateY");
            //        sb.Children.Add(ya);

            //        var aa = new DoubleAnimation();
            //        aa.BeginTime = beginTime;
            //        aa.Duration = TimeSpan.FromSeconds(1);
            //        aa.To = hsv.H;
            //        Storyboard.SetTarget(aa, child.RenderTransform);
            //        Storyboard.SetTargetProperty(aa, "Rotation");
            //        sb.Children.Add(aa);

            //        beginTime += TimeSpan.FromMilliseconds(5);
            //    }
            //}
            //else
            //{
            //    foreach (var child in grid.Children)
            //    {
            //        var nc = (NamedColor)((FrameworkElement)child).DataContext;

            //        var xa = new DoubleAnimation();
            //        xa.BeginTime = beginTime;
            //        xa.Duration = TimeSpan.FromSeconds(1);
            //        xa.To = 0;
            //        Storyboard.SetTarget(xa, child.RenderTransform);
            //        Storyboard.SetTargetProperty(xa, "TranslateX");
            //        sb.Children.Add(xa);

            //        var ya = new DoubleAnimation();
            //        ya.BeginTime = beginTime;
            //        ya.Duration = TimeSpan.FromSeconds(1);
            //        ya.To = 0;
            //        Storyboard.SetTarget(ya, child.RenderTransform);
            //        Storyboard.SetTargetProperty(ya, "TranslateY");
            //        sb.Children.Add(ya);

            //        var aa = new DoubleAnimation();
            //        aa.BeginTime = beginTime;
            //        aa.Duration = TimeSpan.FromSeconds(1);
            //        aa.To = 0;
            //        Storyboard.SetTarget(aa, child.RenderTransform);
            //        Storyboard.SetTargetProperty(aa, "Rotation");
            //        sb.Children.Add(aa);

            //        beginTime += TimeSpan.FromMilliseconds(5);
            //    }
            //}

            //sb.Begin();
            //_isArrangedInGrid = !_isArrangedInGrid;

            var border = (Border)sender;
            var grid = border.GetFirstAncestorOfType<UniformGrid>();

            if (_isArrangedInGrid)
            {
                var center = new Point(
                    (grid.ActualWidth - border.ActualWidth) / 2,
                    (grid.ActualHeight - border.ActualHeight) / 2);

                {
                    var sb1 = new Storyboard();

                    var beginTime = TimeSpan.Zero;

                    foreach (var child in grid.Children)
                    {
                        child.RenderTransform = new CompositeTransform();
                        child.RenderTransformOrigin = new Point(0.5, 0.5); 
                        var nc = (NamedColor)((FrameworkElement)child).DataContext;
                        var hsv = nc.Color.ToHsl();
                        var targetX = center.X +
                                        center.X * Math.Sin(hsv.H * Math.PI / 180) *
                                        (0.25 + 0.75 * Math.Min(hsv.L, hsv.S));
                        var targetY = center.Y -
                                        center.Y * Math.Cos(hsv.H * Math.PI / 180) *
                                        (0.25 + 0.75 * Math.Min(hsv.L, hsv.S));
                        var actualPosition =
                            child.TransformToVisual(grid)
                                    .TransformPoint(new Point(0, 0));
                        //Debug.WriteLine(actualPosition);
                        var deltaX = targetX - actualPosition.X;
                        var deltaY = targetY - actualPosition.Y;

                        var xa = new DoubleAnimation();
                        xa.BeginTime = beginTime;
                        xa.Duration = TimeSpan.FromSeconds(1);
                        xa.To = deltaX;
                        Storyboard.SetTarget(xa, child.RenderTransform);
                        Storyboard.SetTargetProperty(xa, "TranslateX");
                        sb1.Children.Add(xa);

                        var ya = new DoubleAnimation();
                        ya.BeginTime = beginTime;
                        ya.Duration = TimeSpan.FromSeconds(1);
                        ya.To = deltaY;
                        Storyboard.SetTarget(ya, child.RenderTransform);
                        Storyboard.SetTargetProperty(ya, "TranslateY");
                        sb1.Children.Add(ya);

                        var aa = new DoubleAnimation();
                        aa.BeginTime = beginTime;
                        aa.Duration = TimeSpan.FromSeconds(1);
                        aa.To = hsv.H;
                        Storyboard.SetTarget(aa, child.RenderTransform);
                        Storyboard.SetTargetProperty(aa, "Rotation");
                        sb1.Children.Add(aa);
                    }

                    await sb1.BeginAsync();
                }

                if (currentCall != _onBorderTappedCall)
                {
                    return;
                }

                const double revolutionDurationInS = 30d;

                foreach (var child in grid.Children)
                {
                    child.RenderTransform = new CompositeTransform();
                    child.RenderTransformOrigin = new Point(0.5, 0.5); 
                    var nc = (NamedColor)((FrameworkElement)child).DataContext;
                    var hsv = nc.Color.ToHsl();
                    var actualPosition = child.TransformToVisual(grid).TransformPoint(new Point(0, 0));

                    var sb = new Storyboard();
                    sb.RepeatBehavior = RepeatBehavior.Forever;

                    var minX = center.X - center.X * (0.25 + 0.75 * Math.Min(hsv.L, hsv.S)) - actualPosition.X;
                    var midX = center.X - actualPosition.X;
                    var maxX = center.X + center.X * (0.25 + 0.75 * Math.Min(hsv.L, hsv.S)) - actualPosition.X;
                    var minY = center.Y - center.Y * (0.25 + 0.75 * Math.Min(hsv.L, hsv.S)) - actualPosition.Y;
                    var midY = center.Y - actualPosition.Y;
                    var maxY = center.Y + center.Y * (0.25 + 0.75 * Math.Min(hsv.L, hsv.S)) - actualPosition.Y;

                    var xa = new DoubleAnimationUsingKeyFrames();
                    xa.KeyFrames.Add(new DiscreteDoubleKeyFrame { KeyTime = TimeSpan.Zero, Value = midX});
                    xa.KeyFrames.Add(new EasingDoubleKeyFrame { KeyTime = TimeSpan.FromSeconds(revolutionDurationInS * 0.25), Value = maxX, EasingFunction = new SineEase { EasingMode = EasingMode.EaseOut } });
                    xa.KeyFrames.Add(new EasingDoubleKeyFrame { KeyTime = TimeSpan.FromSeconds(revolutionDurationInS * 0.50), Value = midX, EasingFunction = new SineEase { EasingMode = EasingMode.EaseIn } });
                    xa.KeyFrames.Add(new EasingDoubleKeyFrame { KeyTime = TimeSpan.FromSeconds(revolutionDurationInS * 0.75), Value = minX, EasingFunction = new SineEase { EasingMode = EasingMode.EaseOut } });
                    xa.KeyFrames.Add(new EasingDoubleKeyFrame { KeyTime = TimeSpan.FromSeconds(revolutionDurationInS * 1.00), Value = midX, EasingFunction = new SineEase { EasingMode = EasingMode.EaseIn } });
                    Storyboard.SetTarget(xa, child.RenderTransform);
                    Storyboard.SetTargetProperty(xa, "TranslateX");
                    sb.Children.Add(xa);

                    var ya = new DoubleAnimationUsingKeyFrames();
                    ya.KeyFrames.Add(new DiscreteDoubleKeyFrame { KeyTime = TimeSpan.Zero, Value = minY });
                    ya.KeyFrames.Add(new EasingDoubleKeyFrame { KeyTime = TimeSpan.FromSeconds(revolutionDurationInS * 0.25), Value = midY, EasingFunction = new SineEase { EasingMode = EasingMode.EaseIn } });
                    ya.KeyFrames.Add(new EasingDoubleKeyFrame { KeyTime = TimeSpan.FromSeconds(revolutionDurationInS * 0.50), Value = maxY, EasingFunction = new SineEase { EasingMode = EasingMode.EaseOut } });
                    ya.KeyFrames.Add(new EasingDoubleKeyFrame { KeyTime = TimeSpan.FromSeconds(revolutionDurationInS * 0.75), Value = midY, EasingFunction = new SineEase { EasingMode = EasingMode.EaseIn } });
                    ya.KeyFrames.Add(new EasingDoubleKeyFrame { KeyTime = TimeSpan.FromSeconds(revolutionDurationInS * 1.00), Value = minY, EasingFunction = new SineEase { EasingMode = EasingMode.EaseOut } });
                    Storyboard.SetTarget(ya, child.RenderTransform);
                    Storyboard.SetTargetProperty(ya, "TranslateY");
                    sb.Children.Add(ya);

                    var aa = new DoubleAnimation();
                    aa.Duration = TimeSpan.FromSeconds(revolutionDurationInS);
                    aa.From = 0;
                    aa.To = 360;
                    Storyboard.SetTarget(aa, child.RenderTransform);
                    Storyboard.SetTargetProperty(aa, "Rotation");
                    sb.Children.Add(aa);
                    //sb.BeginTime =
                    //    TimeSpan.FromSeconds(hsv.H * revolutionDurationInS / 360d);
                    sb.Begin();
                    sb.Seek(TimeSpan.FromSeconds(((hsv.H + 360) % 360) * revolutionDurationInS / 360d));
                }
            }
            else
            {
                var sb = new Storyboard();
                var beginTime = TimeSpan.Zero;

                foreach (var child in grid.Children)
                {
                    //var nc = (NamedColor)((FrameworkElement)child).DataContext;

                    var xa = new DoubleAnimation();
                    xa.BeginTime = beginTime;
                    xa.Duration = TimeSpan.FromSeconds(1);
                    xa.To = 0;
                    Storyboard.SetTarget(xa, child.RenderTransform);
                    Storyboard.SetTargetProperty(xa, "TranslateX");
                    sb.Children.Add(xa);

                    var ya = new DoubleAnimation();
                    ya.BeginTime = beginTime;
                    ya.Duration = TimeSpan.FromSeconds(1);
                    ya.To = 0;
                    Storyboard.SetTarget(ya, child.RenderTransform);
                    Storyboard.SetTargetProperty(ya, "TranslateY");
                    sb.Children.Add(ya);

                    var aa = new DoubleAnimation();
                    aa.BeginTime = beginTime;
                    aa.Duration = TimeSpan.FromSeconds(1);
                    aa.To = 0;
                    Storyboard.SetTarget(aa, child.RenderTransform);
                    Storyboard.SetTargetProperty(aa, "Rotation");
                    sb.Children.Add(aa);

                    //beginTime += TimeSpan.FromMilliseconds(5);
                }

                await sb.BeginAsync();
            }

            _isArrangedInGrid = !_isArrangedInGrid;
            _inAnimation = false;
        }
        private bool TrainFrame(int newid)
        {
            try
            {
                Image <Gray, byte> darkimage = new Image <Gray, byte>(ROIwidth, ROIheight);
                Image <Gray, byte> cropimage = new Image <Gray, byte>(ROIwidth, ROIheight);

                //ArrayList pic = new ArrayList();
                if (loadImage != null)
                {
                    var faces = face.Detect(loadImage, 1.3, 6, HAAR_DETECTION_TYPE.FIND_BIGGEST_OBJECT, new Size(120, 120), new Size(200, 200));
                    if (faces.Length > 0)
                    {
                        foreach (var facecount in faces)
                        {
                            facePosition = new Point(facecount.rect.X, facecount.rect.Y);
                            var eyeObjects = eyeWithGlass.DetectMultiScale(loadImage, 1.3, 6, minEye, maxEye);
                            if (eyeObjects.Length == 2)
                            {
                                Console.WriteLine("eye");
                                if (eyeObjects[0].X > eyeObjects[1].X)
                                {
                                    var temp = eyeObjects[0];
                                    eyeObjects[0] = eyeObjects[1];
                                    eyeObjects[1] = temp;
                                }
                                int betweeneLength    = eyeObjects[1].X - eyeObjects[0].X;
                                int lefteyebrowpoint  = eyeObjects[0].X;                                        //
                                int righteyebrowpoint = eyeObjects[0].X + betweeneLength + eyeObjects[1].Width; //
                                int xxx = (int)((1.5 / 8.0) * betweeneLength);
                                int neareyebrowpoint = (int)(0.2 * betweeneLength);
                                int faceheight       = (int)(2.3 * betweeneLength);


                                loadImage.ROI = new Rectangle(new Point(lefteyebrowpoint - xxx, eyeObjects[0].Y - neareyebrowpoint), new Size((righteyebrowpoint + xxx) - (lefteyebrowpoint - xxx), faceheight));

                                cropimage     = loadImage.Copy().Resize(ROIwidth, ROIheight, INTER.CV_INTER_LINEAR);
                                loadImage.ROI = Rectangle.Empty;
                                loadImage.Draw(new Rectangle(new Point(lefteyebrowpoint - xxx, eyeObjects[0].Y - neareyebrowpoint), new Size((righteyebrowpoint + xxx) - (lefteyebrowpoint - xxx), faceheight)), new Gray(0), 2);
                                if (!cropimage.Equals(darkimage))
                                {
                                    cropimage._EqualizeHist();

                                    imageBox7.Image = cropimage;     //line 2


                                    cropimage.Save(folderPath + tempPath);
                                    string dbPath = (folderPath + tempPath).Replace("\\", "/");
                                    //mydb.InsertImageTraining(newid, dbPath, true);

                                    //File.Delete(tempPath);
                                    eigenRecog.reloadData();
                                    imageBox1.Image = loadImage;
                                    imageBox7.Image = cropimage;
                                    return(true);
                                    //Fish_Recog.reloadData();
                                }
                                else
                                {
                                    imageBox1.Image = loadImage;
                                    imageBox7.Image = cropimage;
                                    return(false);
                                }
                            }
                            else
                            {
                                return(false);
                            }
                        }
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
            return(false);
        }
示例#53
0
 public void PanBy(Point offset)
 {
     PageNavigation.PanBy(new Point(offset.X / PageNavigation.Scale, offset.Y / PageNavigation.Scale));
 }
 public InteractivePoint(Point point, Control control) {
     _point = point;
     _control = control;
 }
示例#55
0
 protected bool IsOnScreen(Point topLeft)
 {
     return(ToolManager.IsOnScreen(topLeft));
 }
示例#56
0
        public static Point GetJointPoint(KinectSensor kinectDevice, Joint joint, Size containerSize, Point offset)
        {
            DepthImagePoint point = kinectDevice.MapSkeletonPointToDepth(joint.Position, kinectDevice.DepthStream.Format);

            point.X = (int)((point.X * containerSize.Width / kinectDevice.DepthStream.FrameWidth) - offset.X);
            point.Y = (int)((point.Y * containerSize.Height / kinectDevice.DepthStream.FrameHeight) - offset.Y);

            return(new Point(point.X, point.Y));
        }
 private void frm_detalleCaja_MouseDown(object sender, MouseEventArgs e)
 {
     Dragging = true;
     DragCursor = Cursor.Position;
     DragForm = this.Location;
 }
		private void UpdateImageView()
		{
			if(m_img == null) return;

			string strZoom = m_tscZoom.Text;
			if(string.IsNullOrEmpty(strZoom) || (strZoom == KPRes.Auto))
			{
				m_pnlImageViewer.AutoScroll = false;
				m_picBox.Dock = DockStyle.Fill;
				m_picBox.Image = m_img;

				if((m_img.Width > m_picBox.ClientSize.Width) ||
					(m_img.Height > m_picBox.ClientSize.Height))
				{
					m_picBox.SizeMode = PictureBoxSizeMode.Zoom;
				}
				else m_picBox.SizeMode = PictureBoxSizeMode.CenterImage;

				return;
			}

			if(!strZoom.EndsWith(@"%")) { Debug.Assert(false); return; }

			int iZoom;
			if(!int.TryParse(strZoom.Substring(0, strZoom.Length - 1), out iZoom))
			{
				Debug.Assert(false);
				return;
			}

			int cliW = m_pnlImageViewer.ClientRectangle.Width;
			int cliH = m_pnlImageViewer.ClientRectangle.Height;

			int dx = (m_img.Width * iZoom) / 100;
			int dy = (m_img.Height * iZoom) / 100;

			float fScrollX = 0.5f, fScrollY = 0.5f;
			if(m_pnlImageViewer.AutoScroll)
			{
				Point ptOffset = m_pnlImageViewer.AutoScrollPosition;
				Size sz = m_picBox.ClientSize;

				if(sz.Width > cliW)
				{
					fScrollX = Math.Abs((float)ptOffset.X / (float)(sz.Width - cliW));
					if(fScrollX < 0.0f) { Debug.Assert(false); fScrollX = 0.0f; }
					if(fScrollX > 1.0f) { Debug.Assert(false); fScrollX = 1.0f; }
				}

				if(sz.Height > cliH)
				{
					fScrollY = Math.Abs((float)ptOffset.Y / (float)(sz.Height - cliH));
					if(fScrollY < 0.0f) { Debug.Assert(false); fScrollY = 0.0f; }
					if(fScrollY > 1.0f) { Debug.Assert(false); fScrollY = 1.0f; }
				}
			}
			m_pnlImageViewer.AutoScroll = false;

			m_picBox.Dock = DockStyle.None;
			m_picBox.SizeMode = PictureBoxSizeMode.AutoSize;

			int x = 0, y = 0;
			if(dx < cliW) x = (cliW - dx) / 2;
			if(dy < cliH) y = (cliH - dy) / 2;

			m_picBox.Location = new Point(x, y);

			if((dx == m_img.Width) && (dy == m_img.Height))
				m_picBox.Image = m_img;
			else if((m_imgResized != null) && (m_imgResized.Width == dx) &&
				(m_imgResized.Height == dy))
				m_picBox.Image = m_imgResized;
			else
			{
				Image imgToDispose = m_imgResized;

				m_imgResized = GfxUtil.ScaleImage(m_img, dx, dy);
				m_picBox.Image = m_imgResized;

				if(imgToDispose != null) imgToDispose.Dispose();
			}

			m_pnlImageViewer.AutoScroll = true;

			int sx = 0, sy = 0;
			if(dx > cliW) sx = (int)(fScrollX * (float)(dx - cliW));
			if(dy > cliH) sy = (int)(fScrollY * (float)(dy - cliH));
			try { m_pnlImageViewer.AutoScrollPosition = new Point(sx, sy); }
			catch(Exception) { Debug.Assert(false); }
		}
示例#59
-8
 public Texte(string message, Point position)
 {
     this.message = message;
     this.position = position;
     this.couleur = Structure.Color.White;
     this.police = Fonte.Arial15;
 }
示例#60
-14
 public Texte(string message, Point position, Color couleur, Fonte police)
 {
     this.message = message;
     this.position = position;
     this.couleur = couleur;
     this.police = police;
 }