예제 #1
0
        private void resizePicture(FileInfo file, bool waterMark, Image logo, string type, Int32 width, Int32 height)
        {
            Image       image = Bitmap.FromFile(file.FullName);
            ResizeModel model = new ResizeModel();

            model.Source         = image;
            model.Position       = WatermarkPositions.Center;
            model.IsWartermarked = waterMark;
            if (waterMark && logo != null)
            {
                model.IsWartermarked  = true;
                model.ImageWartermark = logo;
            }
            model.ResizeType = ResizeTypes.Auto;
            model.Width      = width;
            model.Height     = height;
            string destPath = GetResizedFilePath(file, type);

            PathUtils.CreateDirectory(destPath);
            //if (!File.Exists(destPath))
            //{
            Image destImage = PictureOperation.Resize(model);

            PictureOperation.Save(destImage, destPath);
            //}
        }
예제 #2
0
        /// <summary>
        /// 窗体加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainLogin_Load(object sender, EventArgs e)
        {
            PictureOperation.SetPicture(pictureBox1, "pic/logo.jpg");
            PictureOperation.SetPicture(pictureBox2, "pic/ice.png");

            User user = uManager.LoginInitial();

            if (user == null)
            {
                chkSavePassword.Checked = false;
            }
            else
            {
                chkSavePassword.Checked = true;
                textBox1.Text           = user.UserName;
                textBox2.Text           = user.UserPass;
            }
        }
예제 #3
0
 private void MainInitial_Load(object sender, EventArgs e)
 {
     PictureOperation.SetPicture(pictureBox1, "pic/3.jpg");
     progressBar1.Value = 1;
 }
예제 #4
0
 private void MainLock_Load(object sender, EventArgs e)
 {
     PictureOperation.SetPicture(pictureBox1, "pic/logo.jpg");
     PictureOperation.SetPicture(pictureBox2, "pic/ice.png");
 }