How to create an Icon with Multiple Sized Images

I occasionally need to create Icons for Windows apps and websites – but not so often that I can always remember how to do it.
The free open-source image manipulating tool Gimp does the job perfectly and the latest version is easy – but it still takes me a few goes fiddling before getting it right.
I always start from one large ‘png’ images created with transparency to allow for any shape.
So I thought it would be helpful to document exactly what to do for future icons:

1. Start Gimp
2. Click Menu -> File -> Open as Layers
select your master ‘png’ file (size >= largest icon size)
b. click ‘Open Button’
3. Click Menu -> Layer -> Scale Layer
Enter largest (next) size of Icon element you want to include (eg 256 by 256)
Click the Scale button
4. Click Menu -> Layer -> Duplicate Layer
Enter Repeat step 3 and this step for next smaller Icon element Sizes
5. Click Menu -> File -> Save As to save your work as a Gimp XCF file
6. Click Menu -> File -> Export As
Edit your filename as required and use ‘.ico’ extension
7. To Include your Icon (Favicon) in an HTML web page:
Add the HTML following code to your HTML header:
<link rel=”icon” type=”image/x-icon” href=”./images/favicon.ico”>
Editing icon name and its’ relative location.

MagicWaterMark now available

My unique WaterMarking software is finally available.
I’ve still got lots to do creating all the support documents and videos – but at least you can get your own fully working and tested copy to try out at MagicWaterMark
Designed for use on PCs running Windows 10 or 11 for creators of Websites.
Able to add text and image watermarks to your Pictures one at a time – or hundreds together!

Whats unique about MagicWaterMark is that you can add text watermarks that automatically choose their color in contrast to each Picture they are added to!

There’s also a ton of features you aren’t likely to find elsewhere.
For example you can set the quality of watermarked images – typically reducing file sizes by half or much more.
This halves Picture download time and doubles the speed at which your web pages will be shown.
Even better it could save you $$$ on web-hosting bandwidth.

You can prepare a variety of your text or image watermarks one time then pick the ones you want to use for different websites.

There are 4 different versions available ranging in price from just $7 to $37 for one-time perpetual licenses.

A single Trial Version lets you check out the exact features of each version before deciding if you want to buy a license to remove the trial watermarks.
If you are uncertain which version to choose why not start with the cheapest? Not much more than the cost your daily coffee!
Version Upgrade Licenses are fully available – all from within the single Trial Version download.

Adding watermarks doesn’t have to be used to protect your Pictures.
Maybe more important is to add your own branding and links – so you can always be found by anyone viewing them?

Visual Studio 2022 WebView2 bugs

I’ve been tearing my hair out for the last couple of days – trying to work out why previous perfectly good apps completely crashed WebView2 using Visual Studio 2022!

Visual Studio 2022 smoothly allows WebView2 to be installed and loaded into the toolbox. But using it kept failing on:
 ‘WebView21_CoreWebView2InitializationCompleted(sender As Object, e As Microsoft.Web.WebView2.Core.CoreWebView2InitializationCompletedEventArgs) Handles WebView21.CoreWebView2InitializationCompleted’
Returning e.IsSuccess = False

With the message:
{“Couldn’t find a compatible Webview2 Runtime installation to host WebViews.”}

I repeatedly tried repairing & reinstalling Webview2 and Microsoft Edge WebView2 Runtime, trying many different versions – none worked.

Microsoft documentation for WebView2 suggests uninstalling Microsoft Edge – even though they also say WebView2 is completely separate (to avoid updates needing to be synchronised)

Yet Microsoft Edge can no longer be removed because it is now an integral part of Windows! But ‘repairing’ it didn’t help either.

My previously saved and packaged ‘release’ software from Visual Studio 2022 ALL still worked as ‘stand-alone’ apps, but copying working runtime files from these into newly created releases still failed.

Eventually I gave up with Visual Studio 2022 and went back to an app created with Visual Studio 2019 – and voila it worked fine, even allowing debugging! This wasn’t really going to solve my problem because all my latest apps use .net 8 which can’t easily be ported back to .net 4.8 Frameword

Nevertheless as an experiment I created a new app to test WebView2 using Visual Studio 2019 with .Net Framework 4.8 and that also worked first time! (after the usual fiddle to get WebView2 to appear in my toolbox)

Yet anything I tried creating in Visual Studio 2022 with .Net 6, 7 or 8 failed miserably.

In creating a new app in Visual Studio 2019 it wanted to use the default directory of:
c:/users/myname/source/repos/appname.

I changed it to where I save all my apps:
d:/myname/documents/VisualStudio2024 and it still worked.

Finally, I thought I would see what happened if I used Visual Studio 2022 to create and save a simple WebView2 app in:
c:/users/myname/source/repos/appname

And guess what – it worked first time!!!

In summary, if you are having problems with Visual Studio 2022 running WebView2 – make sure you work from your user /source/repos folder.

If only I could charge Microsoft for some of my time wasted finding work-arounds for their bugs!
Anyway, hope this sorry tale helps a few other programmers struggling with the same problem.