xBRZ for runtime upscale of icons/images of High DPI aware applications
This XP compatible DLL is a better upscaling solution for VB6 LOB applications which need to scale their 16x16 icons at runtime for High DPI screens.
xBRZ is a pixel-art scaling algorithm which can be used to upscale application icons and images for modern High DPI aware applications.
The xBRZ upscaler seems to be especially successful with 16x16 icons and produces much better upscaled High DPI icons (esp. x2 and x3 factors) compared to bicubic interpolation.
Re: xBRZ for runtime upscale of icons/images of High DPI aware applications
Fascinating project. When it is stable - and there are some instructions and a sample project in VB6 using the DLL - I'll have a deeper look. Could be useful.
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
Re: xBRZ for runtime upscale of icons/images of High DPI aware applications
Here is how the main toolbar turned out in one of our LOB apps.
Animation steps in 100% DPI to 225% DPI on a Win11 box. App in standard (non-darkmode) color theme.
The app supports Large Icons option which upscales images +8 px i.e. with option turned on the icons upscale once more 16 -> 24 px, 24 -> 32 px, 32 -> 40 px, etc. depending on current DPI screen settings.
The buttons in screenshot are resized using ScalePicture function linked above.
Re: xBRZ for runtime upscale of icons/images of High DPI aware applications
That's really good, future proofing your older apps, VB6 and otherwise, always leaves the smaller icons lagging behind. In my programs I have been looking at resize ratio and then dynamically loading larger versions of JPGs as required, that works to an extent but as screen sizes grow you find find yourself regularly having to add increasingly larger images.
Can it operate only on standalone ICO files or does it manage to extract embedded icons with DLLs/RES/binaries. Does it operate on other standalone image types, JPGs for example?
The functionality is really appreciated but it would be nice if you could make that DLL a fully native VB6 app. I know that may be a lot of work.
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
Re: xBRZ for runtime upscale of icons/images of High DPI aware applications
ScalePicture function works on StdPictures i.e. after ICO/JPG is loaded from file or resource.
> . . . it would be nice if you could make that DLL a fully native VB6 app. I know that may be a lot of work.
Yes, the algorithm and original C++ implementation look complicated but I found out there are Java, .Net and JS ports so it seems more doable now.
The weirdest thing I found out during this project is that at present there is no C++17 (or C++20 and beyond) compiler which emits 32-bit XP compatible binaries. Had to backport original xBRZ sources to C++14 and managed to trip on a landmine in VS2015 runtime with *documented* XP incompatibility on global state initialization vs threading.
Re: xBRZ for runtime upscale of icons/images of High DPI aware applications
Originally Posted by wqweto
ScalePicture function works on StdPictures i.e. after ICO/JPG is loaded from file or resource.
Understood
Originally Posted by wqweto
Yes, the algorithm and original C++ implementation look complicated but I found out there are Java, .Net and JS ports so it seems more doable now.
I look forward to seeing that and it will make it much more likely to end up in all our apps if that;s the case.
Originally Posted by wqweto
The weirdest thing I found out during this project is that at present there is no C++17 (or C++20 and beyond) compiler which emits 32-bit XP compatible binaries.
That is a bit rubbish, what's the point of emitting 32bit binaries if not for running on XP?
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
Re: xBRZ for runtime upscale of icons/images of High DPI aware applications
I've made a version of this project for twinBASIC that supports 64bit via switching to my standard Windows Development Library package, replacing the VBIDE-dependent demo form with something much less fancy but still getting the idea across.
Re: xBRZ for runtime upscale of icons/images of High DPI aware applications
Btw, you do realize the VB6 port is 100% Claude generated. First I used sonette 4.6 for inital implementation and then told opus 4.8 to just fix the bugs compared to original C/C++ version which was weird it actually found all bugs and it worked.