Switching from my base64 code to the code supplied by sdtools
This commit is contained in:
parent
65f0c9faf6
commit
ab769bf7d2
@ -6,6 +6,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BarRaider.SdTools;
|
||||
|
||||
namespace FocusVolumeControl
|
||||
{
|
||||
@ -51,15 +52,7 @@ namespace FocusVolumeControl
|
||||
try
|
||||
{
|
||||
var icon = Icon.ExtractAssociatedIcon(session.ExecutablePath);
|
||||
var bitmap = new Bitmap(icon.ToBitmap(), 48, 48);
|
||||
|
||||
using var ms = new MemoryStream();
|
||||
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
|
||||
|
||||
|
||||
var base64Icon = Convert.ToBase64String(ms.ToArray());
|
||||
|
||||
iconData = $"data:image/png;base64,{base64Icon}";
|
||||
iconData = Tools.ImageToBase64(icon.ToBitmap(), true);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user