📄 pictureproperty.cs
字号:
this.lbModified.Size = ((System.Drawing.Size)(resources.GetObject("lbModified.Size")));
this.lbModified.Text = resources.GetString("lbModified.Text");
//
// lbModifiedLabel
//
this.lbModifiedLabel = new System.Windows.Forms.Label();
this.lbModifiedLabel.Parent = this;
this.lbModifiedLabel.Font = ((System.Drawing.Font)(resources.GetObject("lbModifiedLabel.Font")));
this.lbModifiedLabel.Location = ((System.Drawing.Point)(resources.GetObject("lbModifiedLabel.Location")));
this.lbModifiedLabel.Size = ((System.Drawing.Size)(resources.GetObject("lbModifiedLabel.Size")));
this.lbModifiedLabel.Text = resources.GetString("lbModifiedLabel.Text");
//
// lbCreated
//
this.lbCreated = new System.Windows.Forms.Label();
this.lbCreated.Parent = this;
this.lbCreated.Font = ((System.Drawing.Font)(resources.GetObject("lbCreated.Font")));
this.lbCreated.Location = ((System.Drawing.Point)(resources.GetObject("lbCreated.Location")));
this.lbCreated.Size = ((System.Drawing.Size)(resources.GetObject("lbCreated.Size")));
this.lbCreated.Text = resources.GetString("lbCreated.Text");
//
// lbCreatedLabel
//
this.lbCreatedLabel = new System.Windows.Forms.Label();
this.lbCreatedLabel.Parent = this;
this.lbCreatedLabel.Font = ((System.Drawing.Font)(resources.GetObject("lbCreatedLabel.Font")));
this.lbCreatedLabel.Location = ((System.Drawing.Point)(resources.GetObject("lbCreatedLabel.Location")));
this.lbCreatedLabel.Size = ((System.Drawing.Size)(resources.GetObject("lbCreatedLabel.Size")));
this.lbCreatedLabel.Text = resources.GetString("lbCreatedLabel.Text");
//
// pa1
//
this.pa1 = new System.Windows.Forms.Panel();
this.pa1.Parent = this;
this.pa1.BackColor = System.Drawing.Color.Gray;
this.pa1.Location = ((System.Drawing.Point)(resources.GetObject("pa1.Location")));
this.pa1.Size = new System.Drawing.Size(224, 2);
//
// lbLocation
//
this.lbLocation = new System.Windows.Forms.Label();
this.lbLocation.Parent = this;
this.lbLocation.Font = ((System.Drawing.Font)(resources.GetObject("lbLocation.Font")));
this.lbLocation.Location = ((System.Drawing.Point)(resources.GetObject("lbLocation.Location")));
this.lbLocation.Size = ((System.Drawing.Size)(resources.GetObject("lbLocation.Size")));
this.lbLocation.Text = resources.GetString("lbLocation.Text");
//
// lbLocationLabel
//
this.lbLocationLabel = new System.Windows.Forms.Label();
this.lbLocationLabel.Parent = this;
this.lbLocationLabel.Font = ((System.Drawing.Font)(resources.GetObject("lbLocationLabel.Font")));
this.lbLocationLabel.Location = ((System.Drawing.Point)(resources.GetObject("lbLocationLabel.Location")));
this.lbLocationLabel.Size = ((System.Drawing.Size)(resources.GetObject("lbLocationLabel.Size")));
this.lbLocationLabel.Text = resources.GetString("lbLocationLabel.Text");
//
// pa2
//
this.pa2 = new System.Windows.Forms.Panel();
this.pa2.Parent = this;
this.pa2.BackColor = System.Drawing.Color.Gray;
this.pa2.Size = new System.Drawing.Size(224, 2);
this.pa2.Location = ((System.Drawing.Point)(resources.GetObject("pa2.Location")));
//
// pbThumbnail
//
this.pbThumbnail = new System.Windows.Forms.PictureBox();
this.pbThumbnail.Parent = this;
this.pbThumbnail.Location = new System.Drawing.Point(76, 2);
this.pbThumbnail.Size = new System.Drawing.Size(68, 68);
this.pbThumbnail.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
//
// chCompressed
//
this.chCompressed = new System.Windows.Forms.CheckBox();
this.chCompressed.Parent = this;
this.chCompressed.Enabled = false;
this.chCompressed.Font = ((System.Drawing.Font)(resources.GetObject("chCompressed.Font")));
this.chCompressed.Location = ((System.Drawing.Point)(resources.GetObject("chCompressed.Location")));
this.chCompressed.Size = ((System.Drawing.Size)(resources.GetObject("chCompressed.Size")));
this.chCompressed.Text = resources.GetString("chCompressed.Text");
//
// chDevice
//
this.chDevice = new System.Windows.Forms.CheckBox();
this.chDevice.Parent = this;
this.chDevice.Enabled = false;
this.chDevice.Font = ((System.Drawing.Font)(resources.GetObject("chDevice.Font")));
this.chDevice.Location = ((System.Drawing.Point)(resources.GetObject("chDevice.Location")));
this.chDevice.Size = ((System.Drawing.Size)(resources.GetObject("chDevice.Size")));
this.chDevice.Text = resources.GetString("chDevice.Text");
//
// chNormal
//
this.chNormal = new System.Windows.Forms.CheckBox();
this.chNormal.Parent = this;
this.chNormal.Enabled = false;
this.chNormal.Font = ((System.Drawing.Font)(resources.GetObject("chNormal.Font")));
this.chNormal.Location = ((System.Drawing.Point)(resources.GetObject("chNormal.Location")));
this.chNormal.Size = ((System.Drawing.Size)(resources.GetObject("chNormal.Size")));
this.chNormal.Text = resources.GetString("chNormal.Text");
//
// chTemporary
//
this.chTemporary = new System.Windows.Forms.CheckBox();
this.chTemporary.Parent = this;
this.chTemporary.Enabled = false;
this.chTemporary.Font = ((System.Drawing.Font)(resources.GetObject("chTemporary.Font")));
this.chTemporary.Location = ((System.Drawing.Point)(resources.GetObject("chTemporary.Location")));
this.chTemporary.Size = ((System.Drawing.Size)(resources.GetObject("chTemporary.Size")));
this.chTemporary.Text = resources.GetString("chTemporary.Text");
}
#endregion
private void DisplayFileInfos()
{
ResourceManager rm = new ResourceManager(GetType().Namespace + "." + "PexRes", this.GetType().Assembly);
FileInfo selectedInfo = new FileInfo(picture);
//
// Name and location
//
this.Text = rm.GetString("PexTitle") + " - " + rm.GetString("Properties");
lbName.Text = selectedInfo.Name;
lbLocation.Text = selectedInfo.DirectoryName;
if( selectedInfo.Length < 1024 )
{
lbFileSize.Text = selectedInfo.Length + " " + rm.GetString("FileSizeUnitByte");
}
else if ( selectedInfo.Length < 1048576 )
{
double KB = 1024 + double.Epsilon;
double weight = selectedInfo.Length / KB;
lbFileSize.Text = String.Format("{0:F1} {1}", weight, rm.GetString("FileSizeUnitKB"));
}
else
{
double MB = 1048576 + double.Epsilon;
double weight = selectedInfo.Length / MB;
lbFileSize.Text = String.Format("{0:F1} {1}", weight, rm.GetString("FileSizeUnitMB"));
}
//
// File dates
//
lbCreated.Text = selectedInfo.CreationTime.ToShortDateString() + " " + selectedInfo.CreationTime.ToShortTimeString();
lbModified.Text = selectedInfo.LastWriteTime.ToShortDateString() + " " + selectedInfo.LastWriteTime.ToShortTimeString();
//
// File attributes
//
FileAttributes attr = selectedInfo.Attributes;
chArchive.Checked = ( ( attr & FileAttributes.Archive ) == FileAttributes.Archive ) ? true : false;
chCompressed.Checked = ( ( attr & FileAttributes.Compressed ) == FileAttributes.Compressed ) ? true : false;
chDevice.Checked = ( ( attr & FileAttributes.Device ) == FileAttributes.Device ) ? true : false;
chHidden.Checked = ( ( attr & FileAttributes.Hidden ) == FileAttributes.Hidden ) ? true : false;
chNormal.Checked = ( ( attr & FileAttributes.Normal ) == FileAttributes.Normal ) ? true : false;
chReadOnly.Checked = ( ( attr & FileAttributes.ReadOnly ) == FileAttributes.ReadOnly ) ? true : false;
chSystem.Checked = ( ( attr & FileAttributes.System ) == FileAttributes.System ) ? true : false;
chTemporary.Checked = ( ( attr & FileAttributes.Temporary ) == FileAttributes.Temporary ) ? true : false;
}
private void DisplayThumbnail()
{
ResourceManager rm = new ResourceManager(GetType().Namespace + "." + "PexRes", this.GetType().Assembly);
Bitmap selected = new Bitmap(picture);
lbSize.Text = string.Format("{0} * {1} {2}", selected.Width, selected.Height, rm.GetString("Pixels"));
Bitmap thumb = ImageProcessor.GetThumbnailImage(
selected,
pbThumbnail.Width,
pbThumbnail.Height,
false,
false);
pbThumbnail.Image = thumb;
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad (e);
picture = ImageFileList.Singleton.Current;
DisplayFileInfos();
DisplayThumbnail();
Cursor.Current = Cursors.Default;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -