diff --git a/BookmarkForm.cs b/BookmarkForm.cs index 6af7b81..782fb98 100644 --- a/BookmarkForm.cs +++ b/BookmarkForm.cs @@ -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) diff --git a/Classes/IconDatabase.cs b/Classes/IconDatabase.cs index 4e1fc98..2b2df3a 100644 --- a/Classes/IconDatabase.cs +++ b/Classes/IconDatabase.cs @@ -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[])); } } diff --git a/MainForm.cs b/MainForm.cs index 2686d9c..7342740 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -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); diff --git a/Windows/Forms/BookmarkTreeView.cs b/Windows/Forms/BookmarkTreeView.cs index b4fcf69..e2d4496 100644 --- a/Windows/Forms/BookmarkTreeView.cs +++ b/Windows/Forms/BookmarkTreeView.cs @@ -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); - }