|
-
May 11th, 2025, 03:31 PM
#1
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.
The ScalePicture procedure resizes to 150% by first upscaling x2 with xBRZ to 200% and then downsampling to 150% using WIC for bicubic interpolation.
cheers,
</wqw>
p.s. xBRZ name apparently comes from "xScale By Rules" (the original idea of xBR algorithm on GPU) and Zenju (the author of CPU based implementation).
p.p.s. Implementing the algorithm in pure VB6 is to be done.
Last edited by wqweto; May 12th, 2025 at 05:31 AM.
-
May 11th, 2025, 07:57 PM
#2
Re: xBRZ for runtime upscale of icons/images of High DPI aware applications
Example crashes the IDE and screws up Windows itself for a few minutes here. Win10/manifested IDE. (Yes VB6 lol, I saw the VB.IDE ref)
-
May 12th, 2025, 02:40 AM
#3
Re: xBRZ for runtime upscale of icons/images of High DPI aware applications
 Originally Posted by fafalone
Example crashes the IDE and screws up Windows itself for a few minutes here. Win10/manifested IDE. (Yes VB6 lol, I saw the VB.IDE ref)
Weird. Just needed some 16x16 icons to upscale so tried to "extract" these from VBIDE's CommandBars.
Edit: Just pushed 349bd04 a cleanup for the test project to enumerate only first 4 built-in command bars.
cheers,
</wqw>
Last edited by wqweto; May 12th, 2025 at 02:45 AM.
-
May 12th, 2025, 05:15 AM
#4
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.
https://github.com/yereverluvinunclebert
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.
-
May 12th, 2025, 06:09 AM
#5
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.
cheers,
</wqw>
-
May 12th, 2025, 07:08 AM
#6
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.
https://github.com/yereverluvinunclebert
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.
-
May 12th, 2025, 08:12 AM
#7
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.
cheers,
</wqw>
-
May 12th, 2025, 09:40 AM
#8
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?
https://github.com/yereverluvinunclebert
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
Demo doesn't work for me...
-
Re: xBRZ for runtime upscale of icons/images of High DPI aware applications
 Originally Posted by fafalone
Demo doesn't work for me...
Try clicking on the icons to see them upscaled but you'll need compiled xbrz.dll placed somewhere loadable.
Btw, I've just updated the test project to use pure VB6 implementation instead (original DLL calls left behind #Const ImplUseExternalXbrz = 0).
cheers,
</wqw>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|