Example #1
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);
        }
 // 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);
 }
 // Token: 0x06001798 RID: 6040 RVA: 0x000074C2 File Offset: 0x000056C2
 protected void method_12(Rectangle window_bounds, Struct46 bounds)
 {
     this.method_13(window_bounds, bounds.method_0(window_bounds.Size).smethod_9());
 }