Fixed: icon transparency fault

This commit is contained in:
Ray 2021-09-28 18:08:53 +01:00
parent 4c031108f0
commit 2af53adcae
4 changed files with 13 additions and 43 deletions

View File

@ -322,7 +322,6 @@ namespace FizzyLauncher
};
}
protected bool IsBusy
{
get => isBusy;
@ -388,7 +387,7 @@ namespace FizzyLauncher
});
}
private Image RetrieveImage(string url)
private Bitmap RetrieveImage(string url)
{
if (string.IsNullOrWhiteSpace(url))
{
@ -408,6 +407,7 @@ namespace FizzyLauncher
}
Image img = Image.FromStream(new MemoryStream(byteData));
return new Bitmap(img, 16, 16);
}
catch (Exception)

View File

@ -3,7 +3,6 @@ using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Windows.Forms;
namespace BookmarkManager
{
@ -96,7 +95,6 @@ namespace BookmarkManager
return true;
}
public Image FindIcon(string id)
{
if (dbConnection == null) return null;
@ -148,7 +146,8 @@ namespace BookmarkManager
return null;
}
return new Bitmap(img, 16, 16);
return img;
//return new Bitmap(img, 16, 16);
}
public bool HasIcon(string id)
@ -236,11 +235,14 @@ namespace BookmarkManager
protected byte[] ImageToBytes(Image image)
{
MemoryStream stream = new MemoryStream();
image.Save(stream, ImageFormat.Bmp);
stream.Close();
//MemoryStream stream = new MemoryStream();
//image.Save(stream, image.RawFormat);
//stream.Close();
return stream.ToArray();
//return stream.ToArray();
ImageConverter imageConverter = new ImageConverter();
return (byte[])imageConverter.ConvertTo(image, typeof(byte[]));
}
}

View File

@ -687,19 +687,6 @@ namespace FizzyLauncher
if (nodeType == BookmarkTreeView.NodeType.Page)
{
UpdateBookmarkNode(false);
//BookmarkForm bookmarkForm = new BookmarkForm(treeView1.GetNodeModel(), null);
//if (bookmarkForm.ShowDialog() == DialogResult.OK)
//{
// UpdateBookmarkNode(bookmarkForm);
// //string iconID = Crypto.GetSHA256Hash(bookmarkForm.Model.Item?.SiteName);
// //if (!string.IsNullOrWhiteSpace(iconID))
// //{
// // iconDatabase.AddIcon(iconID, bookmarkForm.Model.Icon);
// //}
// //treeView1.UpdateItem(treeView1.SelectedNode, bookmarkForm.Model.Item);
//}
}
break;
@ -724,24 +711,6 @@ namespace FizzyLauncher
treeView1.SelectedNode = node;
UpdateBookmarkNode(true);
//BookmarkForm bookmarkForm = new BookmarkForm(treeView1.GetNodeModel(), null);
//if (bookmarkForm.ShowDialog() == DialogResult.OK)
//{
// UpdateBookmarkNode(bookmarkForm);
// //string iconID = Crypto.GetSHA256Hash(bookmarkForm.Model.Item?.SiteName);
// //if (!string.IsNullOrWhiteSpace(iconID))
// //{
// // iconDatabase.AddIcon(iconID, bookmarkForm.Model.Icon);
// //}
// //treeView1.UpdateItem(treeView1.SelectedNode, bookmarkForm.Model.Item);
//}
//else
//{
// node.Remove();
//}
}
break;
@ -1104,7 +1073,7 @@ namespace FizzyLauncher
string iconID = Crypto.GetSHA256Hash(bookmarkForm.Model.Item?.SiteName);
if (!string.IsNullOrWhiteSpace(iconID))
{
iconDatabase.AddIcon(iconID, bookmarkForm.Model.Icon);
iconDatabase.AddIcon(iconID, icon);
}
treeView1.UpdateItem(treeView1.SelectedNode, bookmarkForm.Model.Item);

View File

@ -227,7 +227,7 @@ namespace RyzStudio.Windows.Forms
this.SelectedImageIndex = 0;
this.ShowNodeToolTips = true;
this.ImageList.ColorDepth = ColorDepth.Depth16Bit;
this.ImageList.ColorDepth = ColorDepth.Depth32Bit;
this.ImageList.ImageSize = new Size(16, 16);
this.ImageList.TransparentColor = Color.Transparent;
this.ImageList.Images.Clear();
@ -235,7 +235,6 @@ namespace RyzStudio.Windows.Forms
this.ImageList.Images.Add(Resources.folder);
this.ImageList.Images.Add(Resources.folder_explore);
this.ImageList.Images.Add(Resources.file_text);
}