예제 #1
0
파일: ImageView.cs 프로젝트: lrmymycn/befun
        private void InitData()
        {
            this.Closing += new CancelEventHandler(this.Form_Closing);

            Image image = PictureUtils.GenerateImage(this.image);
            int height = image.Height;
            int width = image.Width;
            this.Width = width + 10;
            this.Height = height + 20;
            this.pictureBox.Width = width;
            this.pictureBox.Height = height;
            PictureUtils.RenderPicture(this.pictureBox, this.image);
        }
예제 #2
0
        public void textBox_LargeURL_Double_Click(object sender, EventArgs e)
        {
            OpenFileDialog fileDialog = new OpenFileDialog();

            fileDialog.Filter          = "Picture(*.jpg;*.jpeg;*.bmp;*.gif;*.png)|*.jpg;*.jpeg;*.bmp;*.gif;*.png|所有文件(*.*)|*.*";
            fileDialog.CheckFileExists = true;
            fileDialog.CheckPathExists = true;
            if (fileDialog.ShowDialog(this) == DialogResult.OK)
            {
                this.currentFileName_large = fileDialog.FileName;
                this.destFileName_large    = this.RefreshUrl(this.currentFileName_large, this.textBox_LargeURL);
                PictureUtils.RenderPicture(this.pictureBox_Large, this.currentFileName_large);
                this.textBox_Name.Text = Utils.GetSafeFileNameWithoutExt(this.destFileName_large);
                this.textBox_Alt.Text  = this.textBox_Name.Text;
            }
        }
예제 #3
0
 public override void renderEntity()
 {
     if (this.entity == null)
     {
         return;
     }
     if (!string.IsNullOrWhiteSpace(this.entity.project_id))
     {
         this.comboBox_Project.SelectedItem = Utils.getSelectedProject(this.projectList, this.entity.project_id);
     }
     this.textBox_Name.Text     = this.entity.name;
     this.textBox_LargeURL.Text = this.entity.large_url;
     if (!string.IsNullOrWhiteSpace(this.entity.large_url))
     {
         this.savedFileName_large   = PathUtils.GenerateAbsoluteMediaPath(this.entity.large_url);
         this.currentFileName_large = this.savedFileName_large;
         this.destFileName_large    = this.savedFileName_large;
         PictureUtils.RenderPicture(this.pictureBox_Large, this.currentFileName_large);
     }
     this.textBox_Alt.Text = this.entity.alt;
     this.comboBox_MediaType.SelectedItem   = Utils.getSelected(this.mediaTypeList, this.entity.media_type);
     this.comboBox_ContentType.SelectedItem = Utils.getSelected(this.contentTypeList, this.entity.content_type);
 }