mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Use extra large icon for files instead of jumbo icon
This commit is contained in:
parent
2c01aea2bc
commit
16c3446d32
2 changed files with 5 additions and 5 deletions
|
@ -528,7 +528,7 @@ public static Icon GetFileIcon(string filePath, bool isSmallIcon)
|
|||
return icon;
|
||||
}
|
||||
|
||||
public static Icon GetJumboFileIcon(string filePath)
|
||||
public static Icon GetJumboFileIcon(string filePath, bool jumboSize = true)
|
||||
{
|
||||
SHFILEINFO shfi = new SHFILEINFO();
|
||||
|
||||
|
@ -538,7 +538,7 @@ public static Icon GetJumboFileIcon(string filePath)
|
|||
IImageList spiml = null;
|
||||
Guid guil = new Guid(NativeConstants.IID_IImageList2);
|
||||
|
||||
SHGetImageList(NativeConstants.SHIL_JUMBO, ref guil, ref spiml);
|
||||
SHGetImageList(jumboSize ? NativeConstants.SHIL_JUMBO : NativeConstants.SHIL_EXTRALARGE, ref guil, ref spiml);
|
||||
IntPtr hIcon = IntPtr.Zero;
|
||||
spiml.GetIcon(shfi.iIcon, NativeConstants.ILD_TRANSPARENT | NativeConstants.ILD_IMAGE, ref hIcon);
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ You should have received a copy of the GNU General Public License
|
|||
using ShareX.HelpersLib;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ShareX
|
||||
|
@ -179,9 +180,8 @@ public void UpdateThumbnail()
|
|||
}
|
||||
else
|
||||
{
|
||||
using (Icon icon = NativeMethods.GetJumboFileIcon(filePath))
|
||||
using (Bitmap bmp = icon.ToBitmap())
|
||||
using (Image img = ImageHelpers.AutoCropTransparent(bmp))
|
||||
using (Icon icon = NativeMethods.GetJumboFileIcon(filePath, false))
|
||||
using (Image img = icon.ToBitmap())
|
||||
{
|
||||
ThumbnailImage = ImageHelpers.ResizeImage(img, ThumbnailSize, false, true);
|
||||
pbThumbnail.Image = ThumbnailImage;
|
||||
|
|
Loading…
Reference in a new issue