// Token: 0x060023CD RID: 9165 RVA: 0x000790CC File Offset: 0x000772CC
        public static Bitmap smethod_3(IntPtr hWnd, Rectangle rec)
        {
            Rectangle rectangle = Class410.smethod_16(hWnd);

            if (rec.Size.Height + rec.Y > rectangle.Size.Height || rec.Size.Width + rec.X > rectangle.Size.Width)
            {
                throw new ArgumentException(string.Format(Class364.string_1, rec.Size, rec.Location, rectangle.Size));
            }
            rec.X += rectangle.X;
            rec.Y += rectangle.Y;
            return(Class364.smethod_4(Class265.GetDesktopWindow(), rec));
        }
 // Token: 0x06001794 RID: 6036 RVA: 0x0003DDC4 File Offset: 0x0003BFC4
 private void method_8()
 {
     if (this.class142_0.ToonTownProcess.ProcessOpen)
     {
         Point point;
         try
         {
             Rectangle rec = Class410.smethod_16(this.intptr_0);
             point = new Point(rec.smethod_10() - base.Width / 2, rec.Bottom - base.Height);
         }
         catch (Win32Exception)
         {
             return;
         }
         if (base.Location != point)
         {
             base.Location = point;
         }
     }
 }
Exemplo n.º 3
0
        // Token: 0x0600280B RID: 10251 RVA: 0x00093E4C File Offset: 0x0009204C
        public static Enum107 smethod_0(Class141 toontownWindow, Class150 original_capture, Struct46 bounds, Class104 settings)
        {
            if (original_capture == null)
            {
                return(Enum107.const_2);
            }
            if (bounds.IsSizeEmpty)
            {
                return(Enum107.const_2);
            }
            IntPtr mainWindowHandle = toontownWindow.MainWindowHandle;

            if (!toontownWindow.ProcessOpen)
            {
                return(Enum107.const_2);
            }
            if (original_capture != null && !Struct46.smethod_0(bounds, Struct46.struct46_0))
            {
                Rectangle rec = bounds.method_0(Class410.smethod_16(mainWindowHandle).Size);
                Enum107   result;
                using (Bitmap bitmap = Class364.smethod_3(mainWindowHandle, rec))
                {
                    using (Class125 @class = new Class125(bitmap))
                    {
                        using (Class150 class2 = new Class150(@class))
                        {
                            if (Class150.smethod_1(class2, original_capture, settings.MaxColorRange))
                            {
                                result = Enum107.const_0;
                            }
                            else
                            {
                                result = Enum107.const_1;
                            }
                        }
                    }
                }
                return(result);
            }
            return(Enum107.const_2);
        }
Exemplo n.º 4
0
        // Token: 0x0600299D RID: 10653 RVA: 0x0009FA44 File Offset: 0x0009DC44
        public static void smethod_4(IntPtr hWnd, Point p)
        {
            Rectangle rectangle = Class410.smethod_16(hWnd);

            if (p.X < 0)
            {
                p.X = 0;
            }
            if (p.Y < 0)
            {
                p.Y = 0;
            }
            if (p.X > rectangle.Width)
            {
                p.X = rectangle.Width;
            }
            if (p.Y > rectangle.Height)
            {
                p.Y = rectangle.Height;
            }
            p.X += rectangle.X;
            p.Y += rectangle.Y;
            Class465.smethod_3(p);
        }
 // Token: 0x0600172D RID: 5933 RVA: 0x0003824C File Offset: 0x0003644C
 protected bool method_10(string message, string question, Struct46 ratio, out Class125 bmp, out Struct46 resulting_ratio)
 {
     bmp             = null;
     resulting_ratio = default(Struct46);
     if (!this.class141_0.ProcessOpen && !this.class141_0.smethod_1(this))
     {
         return(false);
     }
     using (Class499 @class = new Class499(this, true))
     {
         using (DialogBox dialogBox = new DialogBox(question, "Are you ready?", Enum90.const_0, null, false, Enum121.const_1, new Enum39[]
         {
             Enum39.const_0,
             Enum39.const_1
         }))
         {
             @class.method_1(dialogBox, DialogResult.OK);
             DialogResult dialogResult = dialogBox.ShowDialog();
             if (dialogResult != DialogResult.OK)
             {
                 return(false);
             }
             @class.method_4();
             @class.method_6();
         }
         if (this.class141_0.ProcessOpen)
         {
             Class410.smethod_8(this, this.class141_0.MainWindowHandle);
             using (CountDown countDown = new CountDown())
             {
                 @class.method_1(countDown, DialogResult.OK);
                 if (countDown.ShowDialog() == DialogResult.OK)
                 {
                     @class.method_6();
                     @class.method_4();
                     if (this.class141_0.ProcessOpen)
                     {
                         Class410.smethod_8(this, this.class141_0.MainWindowHandle);
                         EventHandler eventHandler        = null;
                         CaptureSetupForm.Class159 class2 = new CaptureSetupForm.Class159();
                         class2.regionSelector_0 = new RegionSelector(this.class141_0.MainWindowHandle);
                         try
                         {
                             @class.method_0(class2.regionSelector_0);
                             Rectangle rectangle = Class410.smethod_16(this.class141_0.MainWindowHandle);
                             class2.regionSelector_0.SelectionBounds      = Rectangle.Empty;
                             class2.regionSelector_0.SelectedRegion       = ratio.method_0(rectangle.Size);
                             class2.regionSelector_0.RegionSelectorType   = Enum124.const_0;
                             class2.regionSelector_0.FullSelect           = false;
                             class2.regionSelector_0.FullSize             = true;
                             class2.regionSelector_0.FullScreenCapture    = true;
                             class2.regionSelector_0.MovableResizeMessage = message + " Press any key to accept or escape to cancel.";
                             Form regionSelector_ = class2.regionSelector_0;
                             if (eventHandler == null)
                             {
                                 eventHandler = new EventHandler(class2.method_0);
                             }
                             regionSelector_.Shown += eventHandler;
                             if (class2.regionSelector_0.ShowDialog() == DialogResult.OK && class2.regionSelector_0.SelectedRegion.smethod_2())
                             {
                                 bmp             = class2.regionSelector_0.SelectedBitmap;
                                 resulting_ratio = Struct46.smethod_3(class2.regionSelector_0.SelectedRegion, new Rectangle(Point.Empty, rectangle.Size));
                                 return(true);
                             }
                         }
                         finally
                         {
                             if (class2.regionSelector_0 != null)
                             {
                                 ((IDisposable)class2.regionSelector_0).Dispose();
                             }
                         }
                     }
                 }
             }
         }
     }
     return(false);
 }
Exemplo n.º 6
0
        private void method_1()
        {
            Rectangle rectangle = Class410.smethod_16(this.toonTownParentForm_0.Handle);

            this.parTeePuttGuideLine_0.Location = new Point(rectangle.Location.X + (rectangle.Width / 2 - this.parTeePuttGuideLine_0.Width / 2), rectangle.Location.Y + ParTeePutt.struct51_0.method_0(rectangle.Height));
        }
        // Token: 0x060015E7 RID: 5607 RVA: 0x00032490 File Offset: 0x00030690
        private void RegionSelector_Load(object sender, EventArgs e)
        {
            this.RegionSelectorControl.BackgroundOverlayColor      = Color.FromArgb(180, Color.Black);
            this.RegionSelectorControl.BorderColor                 = Color.FromArgb(255, Color.Red);
            this.RegionSelectorControl.WindowRegionOverlayColor    = Color.FromArgb(90, 255, 128, 64);
            this.RegionSelectorControl.CloseMessageTextColor       = Color.FromArgb(200, Color.Red);
            this.RegionSelectorControl.CloseMessageBorderTextColor = Color.FromArgb(200, Color.Black);
            this.RegionSelectorControl.SelectorType                = this.RegionSelectorType;
            this.RegionSelectorControl.FullScreen = this.FullScreenCapture;
            if (this.bool_0 && !this.class141_0.ProcessOpen)
            {
                this.method_0();
                return;
            }
            IntPtr mainWindowHandle = this.class141_0.MainWindowHandle;

            if (this.FullScreenCapture)
            {
                try
                {
                    this.RegionSelectorControl.ScreenCapture = (this.bitmap_0 = Class364.smethod_0());
                }
                catch (Exception ex)
                {
                    ex.smethod_0();
                    this.method_0();
                    return;
                }
                if (!this.bool_0)
                {
                    if (this.FullSize)
                    {
                        this.RegionSelectorControl.SelectionBounds = new Rectangle(Point.Empty, SystemInformation.VirtualScreen.Size);
                    }
                    else
                    {
                        this.RegionSelectorControl.SelectionBounds = this.SelectionBounds;
                    }
                    if (this.FullSelect)
                    {
                        this.RegionSelectorControl.SelectedRegion = new Rectangle(Point.Empty, this.RegionSelectorControl.SelectionBounds.Size).smethod_1(this.RegionSelectorControl.SelectionBounds);
                    }
                    else
                    {
                        this.RegionSelectorControl.SelectedRegion = this.SelectedRegion.smethod_1(this.RegionSelectorControl.SelectionBounds);
                    }
                }
                else
                {
                    try
                    {
                        this.rectangle_0 = Class410.smethod_16(mainWindowHandle);
                    }
                    catch (Exception ex2)
                    {
                        ex2.smethod_0();
                        this.method_0();
                        return;
                    }
                    if (SystemInformation.VirtualScreen.X < 0)
                    {
                        this.rectangle_0.X = this.rectangle_0.X - SystemInformation.VirtualScreen.X;
                    }
                    if (SystemInformation.VirtualScreen.Y < 0)
                    {
                        this.rectangle_0.Y = this.rectangle_0.Y - SystemInformation.VirtualScreen.Y;
                    }
                    if (this.FullSize)
                    {
                        this.RegionSelectorControl.SelectionBounds = this.rectangle_0;
                    }
                    else
                    {
                        this.RegionSelectorControl.SelectionBounds = new Rectangle(this.SelectionBounds.Location.smethod_10(this.rectangle_0.Location), this.SelectionBounds.Size);
                    }
                    if (this.FullSelect)
                    {
                        this.RegionSelectorControl.SelectedRegion = this.RegionSelectorControl.SelectionBounds;
                    }
                    else
                    {
                        this.RegionSelectorControl.SelectedRegion = new Rectangle(this.SelectedRegion.Location.smethod_10(this.rectangle_0.Location), this.SelectedRegion.Size).smethod_1(this.RegionSelectorControl.SelectionBounds);
                    }
                }
                base.FormBorderStyle = FormBorderStyle.None;
                base.Location        = SystemInformation.VirtualScreen.Location;
                base.Size            = SystemInformation.VirtualScreen.Size;
            }
            else if (!this.bool_0)
            {
                if (this.FullSize)
                {
                    try
                    {
                        this.RegionSelectorControl.ScreenCapture = (this.bitmap_0 = Class364.smethod_0());
                    }
                    catch (Exception ex3)
                    {
                        ex3.smethod_0();
                        this.method_0();
                        return;
                    }
                    this.RegionSelectorControl.SelectionBounds = this.SelectionBounds;
                    base.Size = SystemInformation.VirtualScreen.Size;
                }
                else
                {
                    try
                    {
                        this.RegionSelectorControl.ScreenCapture = (this.bitmap_0 = Class364.smethod_1(this.SelectionBounds.smethod_8()));
                    }
                    catch (Exception ex4)
                    {
                        ex4.smethod_0();
                        this.method_0();
                        return;
                    }
                    this.RegionSelectorControl.SelectionBounds = new Rectangle(Point.Empty, this.SelectionBounds.Size);
                    base.Size = this.SelectionBounds.Size;
                }
                if (this.FullSelect)
                {
                    this.RegionSelectorControl.SelectedRegion = new Rectangle(Point.Empty, this.RegionSelectorControl.SelectionBounds.Size);
                }
                else
                {
                    this.RegionSelectorControl.SelectedRegion = new Rectangle(this.SelectedRegion.Location.smethod_11(this.SelectionBounds.Location), this.SelectedRegion.Size).smethod_1(this.RegionSelectorControl.SelectionBounds);
                }
                base.FormBorderStyle = FormBorderStyle.Fixed3D;
                base.CenterToScreen();
            }
            else
            {
                if (this.FullSize)
                {
                    try
                    {
                        this.RegionSelectorControl.ScreenCapture   = (this.bitmap_0 = Class364.smethod_2(mainWindowHandle));
                        this.RegionSelectorControl.SelectionBounds = new Rectangle(Point.Empty, Class410.smethod_18(mainWindowHandle));
                    }
                    catch (Exception ex5)
                    {
                        ex5.smethod_0();
                        this.method_0();
                        return;
                    }
                    base.Size            = this.RegionSelectorControl.SelectionBounds.Size;
                    base.FormBorderStyle = FormBorderStyle.Fixed3D;
                    try
                    {
                        base.Location = Class410.smethod_14(mainWindowHandle).Location;
                        goto IL_60F;
                    }
                    catch (Exception ex6)
                    {
                        ex6.smethod_0();
                        this.method_0();
                        return;
                    }
                }
                try
                {
                    this.RegionSelectorControl.ScreenCapture = (this.bitmap_0 = Class364.smethod_3(mainWindowHandle, this.SelectionBounds));
                }
                catch (Exception ex7)
                {
                    ex7.smethod_0();
                    this.method_0();
                    return;
                }
                this.RegionSelectorControl.SelectionBounds = new Rectangle(Point.Empty, this.SelectionBounds.Size);
                base.Size            = this.SelectionBounds.Size;
                base.FormBorderStyle = FormBorderStyle.Fixed3D;
                try
                {
                    base.Location = Class410.smethod_14(mainWindowHandle).Location.smethod_10(this.SelectionBounds.Location);
                }
                catch (Exception ex8)
                {
                    ex8.smethod_0();
                    this.method_0();
                    return;
                }
IL_60F:
                if (this.FullSelect)
                {
                    this.RegionSelectorControl.SelectedRegion = new Rectangle(Point.Empty, this.RegionSelectorControl.SelectionBounds.Size);
                }
                else
                {
                    this.RegionSelectorControl.SelectedRegion = new Rectangle(this.SelectedRegion.Location.smethod_11(this.SelectionBounds.Location), this.SelectedRegion.Size);
                }
            }
            base.TopMost = true;
            base.BringToFront();
            base.Activate();
            switch (this.RegionSelectorType)
            {
            case Enum124.const_0:
                this.toolTip_0.SetToolTip(this.RegionSelectorControl, this.MovableResizeMessage);
                break;

            case Enum124.const_1:
                this.toolTip_0.SetToolTip(this.RegionSelectorControl, this.MovableMessage);
                break;

            case Enum124.const_2:
                this.toolTip_0.SetToolTip(this.RegionSelectorControl, this.LockedMessage);
                break;
            }
            this.RegionSelectorControl.Focus();
        }
        // Token: 0x060023CC RID: 9164 RVA: 0x000790AC File Offset: 0x000772AC
        public static Bitmap smethod_2(IntPtr hWnd)
        {
            Rectangle rec = Class410.smethod_16(hWnd);

            return(Class364.smethod_4(Class265.GetDesktopWindow(), rec));
        }
 // Token: 0x0600179A RID: 6042 RVA: 0x000074E7 File Offset: 0x000056E7
 protected void method_14(Point p)
 {
     this.method_13(Class410.smethod_16(this.intptr_0), p);
 }
 // Token: 0x06001797 RID: 6039 RVA: 0x000074AE File Offset: 0x000056AE
 protected void method_11(Struct46 bounds)
 {
     this.method_12(Class410.smethod_16(this.intptr_0), bounds);
 }
        // Token: 0x06001796 RID: 6038 RVA: 0x0003DE3C File Offset: 0x0003C03C
        protected void method_10(Struct42 pnt)
        {
            Rectangle window_bounds = Class410.smethod_16(this.intptr_0);

            this.method_13(window_bounds, pnt.method_0(new Point(window_bounds.Width, window_bounds.Height)));
        }