Example #1
0
        private void openFile(sizes size)
        {
            ofd.Title       = "Choose image to resize";
            ofd.Filter      = "JPG Files|*.jpg";
            ofd.Multiselect = false;
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                string pathToFile = ofd.FileName;

                Bitmap BITMAP = new Bitmap(pathToFile);

                //if (File.Exists(pathToFile)) File.Delete(pathToFile);

                if (size == sizes._1920)
                {
                    BITMAP = ResizeImage(BITMAP, 1920, 1080);
                }
                if (size == sizes._1080)
                {
                    BITMAP = ResizeImage(BITMAP, 1280, 720);
                }
                if (size == sizes._1024)
                {
                    BITMAP = ResizeImage(BITMAP, 1024, 600);
                }
                if (size == sizes._800)
                {
                    BITMAP = ResizeImage(BITMAP, 800, 480);
                }

                notifyIcon1.BalloonTipTitle = "Resised!";
                notifyIcon1.BalloonTipText  = "New image size is " + BITMAP.Width + " x " + BITMAP.Height;
                notifyIcon1.ShowBalloonTip(1000);

                try
                {
                    var bytes = ImageToByte(BITMAP);
                    File.WriteAllBytes("C:/Users/TEMP.VLO30-11.014/Desktop/Resized.jpg", bytes);
                }
                catch (Exception Ex)
                {
                    MessageBox.Show(Ex.ToString());
                }
            }

            ofd.Dispose();
        }
Example #2
0
        //=============Constructor====================

        public Clothes(string Name, sizes ClothingSize, int quantity)
        {
            this.Name         = Name;
            this.ClothingSize = ClothingSize;
            this.quantity     = quantity;
        }