本文整理汇总了C#中Manina.Windows.Forms.ImageListViewItem类的典型用法代码示例。如果您正苦于以下问题:C# ImageListViewItem类的具体用法?C# ImageListViewItem怎么用?C# ImageListViewItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImageListViewItem类属于Manina.Windows.Forms命名空间,在下文中一共展示了ImageListViewItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: EditThumb
public void EditThumb(ImageListViewItem item)
{
mItem = item;
var videoInfo = GetVideoDetails(mItem.FilePath);
mDuration = (double)videoInfo[ColumnType.Duration];
mWidth = (int)videoInfo[ColumnType.Width];
mHeight = (int)videoInfo[ColumnType.Width];
thumbSampler.Value = 0;
thumbDurationLabel.Text = GalleryUtility.SecondsToTime((int)mDuration);
string thumbName = ThumbUtility.GetThumbPath(mItem.FilePath);
if (item.ThumbnailCacheState == CacheState.Cached)
{
thumbViewer.Image = (Image)mItem.ThumbnailImage;
}
else if (File.Exists(thumbName))
{
using (Image img = Image.FromFile(thumbName))
thumbViewer.Image = new Bitmap(img);
}
else
{
MessageBox.Show("Thumbnail \"" + thumbName + "\" doesn't exist.");
}
CenterToScreen();
Show(mParent);
mParent.Enabled = false;
}
开发者ID:ericpony,项目名称:comic-gallery,代码行数:28,代码来源:VideoThumbEditor.cs
示例2: PopulateListView
private void PopulateListView(DirectoryInfo dirPath)//, Func<FileInfo, Object> comp)
{
var infoList = dirPath.GetFiles("*.*").OrderByDescending(x => x.CreationTime);
imageListView1.Items.Clear();
imageListView1.SuspendLayout();
foreach (FileInfo info in infoList)
{
if (ArchiveThumbEditor.CheckExtension(info.Name) || VideoThumbEditor.CheckExtension(info.Name))
{
ImageListViewItem item = new ImageListViewItem(info.FullName, Path.GetFileNameWithoutExtension(info.Name) + info.Name.ToUpperInvariant());
imageListView1.Items.Add(item, mAdaptor);
}
}
imageListView1.ResumeLayout();
mFilter.Snapshot();
}
开发者ID:ericpony,项目名称:comic-gallery,代码行数:16,代码来源:GalleryForm.Favorites.cs
示例3: EditThumb
public void EditThumb(ImageListViewItem item)
{
string filePath = item.FilePath;
if (VideoThumbEditor.CheckExtension(filePath))
{
if (mVideoThumbEditor == null)
mVideoThumbEditor = new VideoThumbEditor(mForm);
mVideoThumbEditor.EditThumb(item);
}
else if (ArchiveThumbEditor.CheckExtension(filePath))
{
if (mArchiveThumbEditor == null)
mArchiveThumbEditor = new ArchiveThumbEditor(mForm);
mArchiveThumbEditor.EditThumb(item);
}
}
开发者ID:ericpony,项目名称:comic-gallery,代码行数:16,代码来源:ThumbEditor.cs
示例4: EditThumb
public void EditThumb(ImageListViewItem item)
{
if (File.Exists(item.FilePath))
{
long fileSize = new FileInfo(item.FilePath).Length;
if (fileSize > mLargeFileThreshold)
{
DialogResult res = MessageBox.Show("This is a large file (" +
fileSize / 1024 / 1024 / 1024
+ "GB) and takes time to be decompressed. Continue?",
"Confirm going on", MessageBoxButtons.YesNo);
if (res == DialogResult.No)
return;
}
if (item.ThumbnailCacheState == CacheState.Cached)
{
thumbViewer.Image = (Image)item.ThumbnailImage;
}
else
{
thumbViewer.Image = null;
}
mItem = item;
this.Text = item.FilePath;
CenterToScreen();
Show(mParent);
mParent.Enabled = false;
ProgressDialog progress = new ProgressDialog("Extracting files...", ListArchiveContent);
progress.ShowDialog();
string[] fileNameList = (string[])progress.GetResult();
if (fileNameList != null)
{
archiveViewer.Items.AddRange(fileNameList);
}
else
{
CloseEditor();
}
progress.Dispose();
}
else
{
MessageBox.Show("File " + item.FilePath + " does not exists!");
}
}
开发者ID:ericpony,项目名称:comic-gallery,代码行数:47,代码来源:ArchiveThumbEditor.cs
示例5: DrawItem
public override void DrawItem(Graphics g, ImageListViewItem item, ItemState state, Rectangle bounds)
{
base.DrawItem(g, item, state, bounds);
PhotoInfo p = item.Tag as PhotoInfo;
if (ImageListView.View != View.Details && p != null && p.Flickr.Uploaded != null) {
// Draw the image
Image img = item.ThumbnailImage;
if (img != null) {
Size itemPadding = new Size(4, 4);
Rectangle pos = GetSizedImageBounds(img, new Rectangle(bounds.Location + itemPadding, ImageListView.ThumbnailSize));
Image overlayImage = Resource1.Uploaded;
int w = Math.Min(overlayImage.Width, pos.Width);
int h = Math.Min(overlayImage.Height, pos.Height);
g.DrawImage(overlayImage, pos.Left, pos.Bottom - h, w, h);
}
}
}
开发者ID:nikkilocke,项目名称:MyPicturesSync,代码行数:17,代码来源:FlickrInfoRenderer.cs
示例6: DrawItem
/// <summary>
/// Draws the specified item on the given graphics.
/// </summary>
/// <param name="g">The System.Drawing.Graphics to draw on.</param>
/// <param name="item">The ImageListViewItem to draw.</param>
/// <param name="state">The current view state of item.</param>
/// <param name="bounds">The bounding rectangle of item in client coordinates.</param>
public override void DrawItem(Graphics g, ImageListViewItem item, ItemState state, Rectangle bounds)
{
if (item.Index == mImageListView.layoutManager.FirstPartiallyVisible ||
item.Index == mImageListView.layoutManager.LastPartiallyVisible)
{
using (Brush b = new HatchBrush(HatchStyle.BackwardDiagonal, Color.Green, Color.Transparent))
{
g.FillRectangle(b, bounds);
}
}
if (item.Index == mImageListView.layoutManager.FirstVisible ||
item.Index == mImageListView.layoutManager.LastVisible)
{
using (Brush b = new HatchBrush(HatchStyle.ForwardDiagonal, Color.Red, Color.Transparent))
{
g.FillRectangle(b, bounds);
}
}
base.DrawItem(g, item, state, bounds);
}
开发者ID:priceLiu,项目名称:imgListView,代码行数:28,代码来源:DebugRenderer.cs
示例7: OnDropFiles
/// <summary>
/// Raises the DropFiles event.
/// </summary>
/// <param name="e">A DropFileEventArgs that contains event data.</param>
protected virtual void OnDropFiles(DropFileEventArgs e)
{
if (DropFiles != null)
DropFiles(this, e);
if (e.Cancel)
return;
int index = e.Index;
int firstItemIndex = 0;
mSelectedItems.Clear(false);
// Add items
bool first = true;
foreach (string filename in e.FileNames)
{
ImageListViewItem item = new ImageListViewItem(filename);
if (first || MultiSelect)
{
item.mSelected = true;
first = false;
}
bool inserted = mItems.InsertInternal(index, item, defaultAdaptor);
if (firstItemIndex == 0)
firstItemIndex = item.Index;
if (inserted)
index++;
}
EnsureVisible(firstItemIndex);
OnSelectionChangedInternal();
}
开发者ID:ericpony,项目名称:comic-gallery,代码行数:39,代码来源:ImageListView.cs
示例8: HighlightState
/// <summary>
/// Determines whether the item is highlighted.
/// </summary>
public ItemHighlightState HighlightState(ImageListViewItem item)
{
bool highlighted = false;
if (highlightedItems.TryGetValue(item, out highlighted))
{
if (highlighted)
return ItemHighlightState.HighlightedAndSelected;
else
return ItemHighlightState.HighlightedAndUnSelected;
}
return ItemHighlightState.NotHighlighted;
}
开发者ID:priceLiu,项目名称:imgListView,代码行数:15,代码来源:ImageListViewNavigationManager.cs
示例9: UpdateItemDetailsInternal
/// <summary>
/// Updates item details.
/// This method is invoked from the item cache thread.
/// </summary>
internal void UpdateItemDetailsInternal(ImageListViewItem item, Utility.ShellImageFileInfo info)
{
item.UpdateDetailsInternal(info);
}
开发者ID:ishani,项目名称:InSiDe,代码行数:8,代码来源:ImageListView.cs
示例10: ShowSaved
private void ShowSaved()
{
imageListView1.ShowCheckBoxes = false;
var db = new SqLiteDatabase();
var query = "SELECT * FROM arts_" + _seriesId;
try
{
var dt = db.GetDataTable(query);
imageListView1.Items.Clear();
for (var i = 0; i < dt.Rows.Count; i++)
{
DataRow drow = dt.Rows[i];
var img1 = new ImageListViewItem {FileName = @drow["image"].ToString()};
imageListView1.Items.AddRange(new[] { img1 });
}
}
catch(Exception e){
Console.WriteLine(e.Message);
var createTable = "CREATE TABLE " + "arts_" + _seriesId + "("
+ "_id" + " INTEGER PRIMARY KEY,"
+ "image" + " TEXT"
+
")";
var adb = new ArtsDatabaseEntry(
"res/" + _seriesName + "_banner.jpg");
var adb2 = new ArtsDatabaseEntry("res/" + _seriesName + "_poster.jpg");
var adb3 = new ArtsDatabaseEntry(
"res/" + _seriesName + "_fanart.jpg");
try
{
db.CreateTable(createTable);
db.InsertArts(adb, "arts_" + _seriesId);
db.InsertArts(adb2, "arts_" + _seriesId);
db.InsertArts(adb3, "arts_" + _seriesId);
ShowSaved();
}
catch (Exception crap)
{
MessageBox.Show(crap.Message);
}
}
}
开发者ID:pedja1,项目名称:TVDb,代码行数:42,代码来源:ArtViewer.cs
示例11: ThumbnailCachedEventArgs
/// <summary>
/// Initializes a new instance of the ThumbnailCachedEventArgs class.
/// </summary>
/// <param name="item">The item that is the target of this event.</param>
/// <param name="thumbnail">The cached thumbnail image.</param>
/// <param name="size">The size of the thumbnail request.</param>
/// <param name="thumbnailImage">true if the cached image is a thumbnail image; otherwise false
/// if the image is a large image for gallery or pane views.</param>
public ThumbnailCachedEventArgs(ImageListViewItem item, Image thumbnail, Size size, bool thumbnailImage)
{
Item = item;
Thumbnail = thumbnail;
Size = size;
IsThumbnail = thumbnailImage;
}
开发者ID:Cocotteseb,项目名称:imagelistview,代码行数:15,代码来源:Events.cs
示例12: ItemEventArgs
/// <summary>
/// Initializes a new instance of the ItemEventArgs class.
/// </summary>
/// <param name="item">The item that is the target of this event.</param>
public ItemEventArgs(ImageListViewItem item)
{
Item = item;
}
开发者ID:Cocotteseb,项目名称:imagelistview,代码行数:8,代码来源:Events.cs
示例13: DrawGalleryImage
/// <summary>
/// Draws the large preview image of the focused item in Gallery mode.
/// </summary>
/// <param name="g">The System.Drawing.Graphics to draw on.</param>
/// <param name="item">The ImageListViewItem to draw.</param>
/// <param name="image">The image to draw.</param>
/// <param name="bounds">The bounding rectangle of the preview area.</param>
public override void DrawGalleryImage(Graphics g, ImageListViewItem item, Image image, Rectangle bounds)
{
if (item != null && image != null)
{
Size itemMargin = MeasureItemMargin(ImageListView.View);
Rectangle pos = Utility.GetSizedImageBounds(image, new Rectangle(bounds.X + itemMargin.Width, bounds.Y + itemMargin.Height, bounds.Width - 2 * itemMargin.Width, bounds.Height - 2 * itemMargin.Height - mReflectionSize), 50.0f, 100.0f);
DrawImageWithReflection(g, image, pos, mReflectionSize);
}
}
开发者ID:RyuaNerin,项目名称:OtakuImage,代码行数:16,代码来源:ImageListViewRenderers.cs
示例14: DrawItem
/// <summary>
/// Draws the specified item on the given graphics.
/// </summary>
/// <param name="g">The System.Drawing.Graphics to draw on.</param>
/// <param name="item">The ImageListViewItem to draw.</param>
/// <param name="state">The current view state of item.</param>
/// <param name="bounds">The bounding rectangle of item in client coordinates.</param>
public override void DrawItem(Graphics g, ImageListViewItem item, ItemState state, Rectangle bounds)
{
if (ImageListView.View == Manina.Windows.Forms.View.Thumbnails)
{
// Zoom on mouse over
if ((state & ItemState.Hovered) != ItemState.None)
{
bounds.Inflate((int)(bounds.Width * mZoomRatio), (int)(bounds.Height * mZoomRatio));
if (bounds.Bottom > ItemAreaBounds.Bottom)
bounds.Y = ItemAreaBounds.Bottom - bounds.Height;
if (bounds.Top < ItemAreaBounds.Top)
bounds.Y = ItemAreaBounds.Top;
if (bounds.Right > ItemAreaBounds.Right)
bounds.X = ItemAreaBounds.Right - bounds.Width;
if (bounds.Left < ItemAreaBounds.Left)
bounds.X = ItemAreaBounds.Left;
}
// Get item image
Image img = null;
if ((state & ItemState.Hovered) != ItemState.None)
img = GetImageAsync(item, new Size(bounds.Width - 8, bounds.Height - 8));
if (img == null) img = item.ThumbnailImage;
// Calculate image bounds
Rectangle pos = Utility.GetSizedImageBounds(img, Rectangle.Inflate(bounds, -4, -4));
int imageWidth = pos.Width;
int imageHeight = pos.Height;
int imageX = pos.X;
int imageY = pos.Y;
// Allocate space for item text
if ((state & ItemState.Hovered) != ItemState.None &&
(bounds.Height - imageHeight) / 2 < ImageListView.Font.Height + 8)
{
int delta = (ImageListView.Font.Height + 8) - (bounds.Height - imageHeight) / 2;
bounds.Height += 2 * delta;
imageY += delta;
}
// Paint background
using (Brush bBack = new SolidBrush(ImageListView.BackColor))
{
Utility.FillRoundedRectangle(g, bBack, bounds, 5);
}
using (Brush bItemBack = new SolidBrush(item.BackColor))
{
Utility.FillRoundedRectangle(g, bItemBack, bounds, 5);
}
if ((ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None)) ||
(!ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None) && ((state & ItemState.Hovered) != ItemState.None)))
{
using (Brush bSelected = new LinearGradientBrush(bounds, Color.FromArgb(16, SystemColors.Highlight), Color.FromArgb(64, SystemColors.Highlight), LinearGradientMode.Vertical))
{
Utility.FillRoundedRectangle(g, bSelected, bounds, 5);
}
}
else if (!ImageListView.Focused && ((state & ItemState.Selected) != ItemState.None))
{
using (Brush bGray64 = new LinearGradientBrush(bounds, Color.FromArgb(16, SystemColors.GrayText), Color.FromArgb(64, SystemColors.GrayText), LinearGradientMode.Vertical))
{
Utility.FillRoundedRectangle(g, bGray64, bounds, 5);
}
}
if (((state & ItemState.Hovered) != ItemState.None))
{
using (Brush bHovered = new LinearGradientBrush(bounds, Color.FromArgb(8, SystemColors.Highlight), Color.FromArgb(32, SystemColors.Highlight), LinearGradientMode.Vertical))
{
Utility.FillRoundedRectangle(g, bHovered, bounds, 5);
}
}
// Draw the image
g.DrawImage(img, imageX, imageY, imageWidth, imageHeight);
// Draw image border
if (Math.Min(imageWidth, imageHeight) > 32)
{
using (Pen pGray128 = new Pen(Color.FromArgb(128, Color.Gray)))
{
g.DrawRectangle(pGray128, imageX, imageY, imageWidth, imageHeight);
}
if (System.Math.Min(imageWidth, imageHeight) > 32)
{
using (Pen pWhite128 = new Pen(Color.FromArgb(128, Color.White)))
{
g.DrawRectangle(pWhite128, imageX + 1, imageY + 1, imageWidth - 2, imageHeight - 2);
}
}
}
// Draw item text
if ((state & ItemState.Hovered) != ItemState.None)
//.........这里部分代码省略.........
开发者ID:RyuaNerin,项目名称:OtakuImage,代码行数:101,代码来源:ImageListViewRenderers.cs
示例15: DrawCheckBox
/// <summary>
/// Draws the checkbox icon for the specified item on the given graphics.
/// </summary>
/// <param name="g">The System.Drawing.Graphics to draw on.</param>
/// <param name="item">The ImageListViewItem to draw.</param>
/// <param name="bounds">The bounding rectangle of the checkbox in client coordinates.</param>
public override void DrawCheckBox(Graphics g, ImageListViewItem item, Rectangle bounds)
{
;
}
开发者ID:headchen,项目名称:imagelistview,代码行数:10,代码来源:ImageListViewRenderers.cs
示例16: ItemClickEventArgs
/// <summary>
/// Initializes a new instance of the ItemClickEventArgs class.
/// </summary>
/// <param name="item">The item that is the target of this event.</param>
/// <param name="subItemIndex">Gets the index of the sub item under the hit point.</param>
/// <param name="location">The location of the mouse.</param>
/// <param name="buttons">One of the System.Windows.Forms.MouseButtons values
/// indicating which mouse button was pressed.</param>
public ItemClickEventArgs(ImageListViewItem item, int subItemIndex, Point location, MouseButtons buttons)
{
Item = item;
SubItemIndex = subItemIndex;
Location = location;
Buttons = buttons;
}
开发者ID:Cocotteseb,项目名称:imagelistview,代码行数:15,代码来源:Events.cs
示例17: ItemCollectionChangedEventArgs
/// <summary>
/// Initializes a new instance of the ItemCollectionChangedEventArgs class.
/// </summary>
/// <param name="action">The type of action causing the change.</param>
/// <param name="item">The item that is the target of this event. This parameter will be null
/// if the collection is cleared.</param>
public ItemCollectionChangedEventArgs(CollectionChangeAction action, ImageListViewItem item)
{
Action = action;
Item = item;
}
开发者ID:Cocotteseb,项目名称:imagelistview,代码行数:11,代码来源:Events.cs
示例18: ItemHoverEventArgs
/// <summary>
/// Initializes a new instance of the ItemEventArgs class.
/// </summary>
/// <param name="item">The currently hovered item.</param>
/// <param name="subItemIndex">The index of the hovered sub item.</param>
/// <param name="previousItem">The previously hovered item.</param>
/// <param name="previousSubItemIndex">The index of the sub item that was previously hovered.</param>
public ItemHoverEventArgs(ImageListViewItem item, int subItemIndex, ImageListViewItem previousItem, int previousSubItemIndex)
{
Item = item;
SubItemIndex = subItemIndex;
PreviousItem = previousItem;
PreviousSubItemIndex = previousSubItemIndex;
}
开发者ID:Cocotteseb,项目名称:imagelistview,代码行数:15,代码来源:Events.cs
示例19: DrawPane
/// <summary>
/// Draws the left pane in Pane view mode.
/// </summary>
/// <param name="g">The System.Drawing.Graphics to draw on.</param>
/// <param name="item">The ImageListViewItem to draw.</param>
/// <param name="image">The image to draw.</param>
/// <param name="bounds">The bounding rectangle of the pane.</param>
public override void DrawPane(Graphics g, ImageListViewItem item, Image image, Rectangle bounds)
{
// Draw resize handle
using (Brush bBorder = new SolidBrush(Color.FromArgb(64, 64, 64)))
{
g.FillRectangle(bBorder, bounds.Right - 2, bounds.Top, 2, bounds.Height);
}
bounds.Width -= 2;
if (item != null && image != null)
{
// Calculate image bounds
Size itemMargin = MeasureItemMargin(ImageListView.View);
Rectangle pos = Utility.GetSizedImageBounds(image, new Rectangle(bounds.Location + itemMargin, bounds.Size - itemMargin - itemMargin), 50.0f, 0.0f);
// Draw image
g.DrawImage(image, pos);
bounds.X += itemMargin.Width;
bounds.Width -= 2 * itemMargin.Width;
bounds.Y = pos.Height + 16;
bounds.Height -= pos.Height + 16;
// Item text
if (mImageListView.Columns[ColumnType.Name].Visible && bounds.Height > 0)
{
int y = Utility.DrawStringPair(g, bounds, "", item.Text, mImageListView.Font,
Brushes.White, Brushes.White);
bounds.Y += 2 * y;
bounds.Height -= 2 * y;
}
// File type
if (mImageListView.Columns[ColumnType.FileType].Visible && bounds.Height > 0 && !string.IsNullOrEmpty(item.FileType))
{
using (Brush bCaption = new SolidBrush(Color.FromArgb(196, 196, 196)))
using (Brush bText = new SolidBrush(Color.White))
{
int y = Utility.DrawStringPair(g, bounds, mImageListView.Columns[ColumnType.FileType].Text + ": ",
item.FileType, mImageListView.Font, bCaption, bText);
bounds.Y += y;
bounds.Height -= y;
}
}
// Metatada
foreach (ImageListView.ImageListViewColumnHeader column in mImageListView.Columns)
{
if (column.Type == ColumnType.ImageDescription)
{
bounds.Y += 8;
bounds.Height -= 8;
}
if (bounds.Height <= 0) break;
if (column.Visible &&
column.Type != ColumnType.FileType &&
column.Type != ColumnType.DateAccessed &&
column.Type != ColumnType.FileName &&
column.Type != ColumnType.FilePath &&
column.Type != ColumnType.Name)
{
string caption = column.Text;
string text = item.GetSubItemText(column.Type);
if (!string.IsNullOrEmpty(text))
{
using (Brush bCaption = new SolidBrush(Color.FromArgb(196, 196, 196)))
using (Brush bText = new SolidBrush(Color.White))
{
int y = Utility.DrawStringPair(g, bounds, caption + ": ", text,
mImageListView.Font, bCaption, bText);
bounds.Y += y;
bounds.Height -= y;
}
}
}
}
}
}
开发者ID:RyuaNerin,项目名称:OtakuImage,代码行数:86,代码来源:ImageListViewRenderers.cs
示例20: ThumbnailCachingEventArgs
/// <summary>
/// Initializes a new instance of the ThumbnailCachingEventArgs class.
/// </summary>
/// <param name="item">The item that is the target of this event.</param>
/// <param name="size">The size of the thumbnail request.</param>
public ThumbnailCachingEventArgs(ImageListViewItem item, Size size)
{
Item = item;
Size = size;
}
开发者ID:Cocotteseb,项目名称:imagelistview,代码行数:10,代码来源:Events.cs
注:本文中的Manina.Windows.Forms.ImageListViewItem类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论