Interaction logic for ResizeImage.xaml
상속: System.Windows.Window
        public static void Open(IListItemEx file)
        {
            var f = new ResizeImage();

            f.InitializeComponent();

            f.textBlock1.Text = f.FindResource("txtFilename") + ": " + file.GetDisplayName(SIGDN.NORMALDISPLAY);
            f.cvt             = new Bitmap(file.ParsingName);
            f.textBlock2.Text = f.FindResource("lblHeightCP") + ": " + f.cvt.Height.ToString();
            f.textBlock3.Text = f.FindResource("lblWidthCP") + ": " + f.cvt.Width.ToString();

            f.spinner1.Value = 100;

            f.percsetting = true;

            f.textBox1.Text = f.cvt.Width.ToString();
            f.textBox2.Text = f.cvt.Height.ToString();

            f.percsetting = false;

            f.ShowDialog();


            if (f.Confirm)
            {
                System.Drawing.Bitmap cvt = new Bitmap(file.ParsingName);
                System.Drawing.Bitmap cst = ChangeImageSize(cvt, f.newwidth, f.newheight);

                string ext = file.Extension;

                cst.Save(file.ParsingName + " (" + f.newwidth + " X " + f.newheight + ")" + ext);
                cvt.Dispose();
                cst.Dispose();
            }
        }
예제 #2
0
        public static void Open(IListItemEx file)
        {
            var f = new ResizeImage();

            f.InitializeComponent();

            f.textBlock1.Text = f.FindResource("txtFilename") + ": " + file.GetDisplayName(SIGDN.NORMALDISPLAY);
            f.cvt = new Bitmap(file.ParsingName);
            f.textBlock2.Text = f.FindResource("lblHeightCP") + ": " + f.cvt.Height.ToString();
            f.textBlock3.Text = f.FindResource("lblWidthCP") + ": " + f.cvt.Width.ToString();

            f.spinner1.Value = 100;

            f.percsetting = true;

            f.textBox1.Text = f.cvt.Width.ToString();
            f.textBox2.Text = f.cvt.Height.ToString();

            f.percsetting = false;

            f.ShowDialog();


            if (f.Confirm)
            {
                System.Drawing.Bitmap cvt = new Bitmap(file.ParsingName);
                System.Drawing.Bitmap cst = ChangeImageSize(cvt, f.newwidth, f.newheight);

                string ext = file.Extension;

                cst.Save(file.ParsingName + " (" + f.newwidth + " X " + f.newheight + ")" + ext);
                cvt.Dispose();
                cst.Dispose();
            }

        }
예제 #3
0
        private void btnResize_Click(object sender, RoutedEventArgs e)
        {
            ResizeImage ri = new ResizeImage(Explorer.SelectedItems[0]);
            ri.ShowDialog();
            if (ri.Confirm == true)
            {
                System.Drawing.Bitmap cvt = new Bitmap(Explorer.SelectedItems[0].ParsingName);
                System.Drawing.Bitmap cst = ChangeImageSize(cvt, ri.newwidth, ri.newheight);

                string ext = GetExtension(Explorer.SelectedItems[0].ParsingName);

                cst.Save(Explorer.SelectedItems[0].ParsingName + " (" + ri.newwidth + " X " + ri.newheight + ")" + ext);
                cvt.Dispose();
                cst.Dispose();
            }
        }