-
Content Count
79 -
Joined
-
Last visited
Posts posted by CyberPeter
-
-
On 4/4/2025 at 8:45 PM, Rollo62 said:Maybe this is interesting for setting per control
https://blogs.embarcadero.com/vcl-per-control-styles-coming-in-rad-studio-10-4/
I tried the suggested
TStyleManager::UseSystemStyleAsDefault = true ;
but that doesn't do anything unless I load a style just so that the style manager gets 'activated' :
TStyleManager::TrySetStyle(L"Windows11 Modern Dark", false /*Do not show Error Message*/) ;
which of course negatively affects other custom components that use the Style class to get color information about background etc.
So in order to implement this, everything needs to be reviewed essentially.
That's a bummer.
-
2 hours ago, aehimself said:I had one situation when VCL styles flickered a lot, and that was if they were on an anchored / aligned panel and the form was being resized. Setting .ParentBackround := False on the panel solved this though.
It's just a general thing in more complex applications (I find), especially with ListView and TreeView etc. and especially when the computer runs a bit slower (had some pc fan issues and the reduced speed made it very obvious).
In my applications styles are implemented to be able to support a dark theme but I personally prefer to use simply Windows for the best performance.For a static application with some buttons etc, styles can be nice, but for faster moving data, scrolling etc. Styles reduce the perceived quality of the application (in my view).
When I dynamically create a form with lots of components on it (e.g. an Options Window) there is very obvious flicker as well while the window comes into view -
12 hours ago, Rollo62 said:Flicker? Is that the case under VCL?
Maybe this is interesting for setting per control
https://blogs.embarcadero.com/vcl-per-control-styles-coming-in-rad-studio-10-4/
VCL yes.
Thank you I will check out the article. -
I can set a StyleName for a particular control, for instance:
MyCustomControlDescendant->StyleName = L"Windows11 Modern Light" ;
However, this only works if a Style has been applied application wide:
TStyleManager::TrySetStyle()
(Any Style)
Usually I prefer no Style, because Styles do flicker a lot etc.But for a TrackBar for instance, an ugly control, a Style feels appropriate.
Sadly assigning one to just the control via StyleName is not possible, unless I first load a style application wide
My question, is it possible at all and if so, how ?
-
Understood. So both TBitmap and TGIFImg take TImage.Transparent in account.
From testing it looks like native Icon, PNG, tiff, wmf, and WIC support ignore this setting.For jpg I'm not even sure right now whether I use VCL or WIC (to be tested)
-
I had a minute today, too curious to let this be.
I found an issue in my Stream and after I fixed it, the GIFs render fine with your component @Anders Melander
Except perhaps that the background is not transparent for one of the GIFs.
Left is via WIC, right is via GIFImgYou see this too ?
-
-
Thanks @Anders Melander, I will double check on Monday. I tried to finish too many things in the last few hours of the week. I now also build a list of WIC registered codecs. It's possible I made a mistake. Weird though that all the other formats work without issues. Only (embedded) GIF has an issue at the moment. The Offset is definitely set to 0 (not on my dev system, so can't check, but pretty sure). I'll put some breakpoints on Monday and will check my custom stream that pulls the data from various sources.
-
1
-
-
@Anders Melander Just signing off, Friday evening down under.
I quickly included GIF again and built in 32bit and 64bit (Modern)
LoadFromStream() seems to throw an exception after testing the first two bytes (I think - checked in haste)
removing the include fixes the issue (use of WIC instead)
-
Just now, Anders Melander said:How so?
If I include GIFImg, Image->Picture->LoadFromStream() throws an exception on the two GIFs tried (Passed via a custom Stream)
If I don't include GIFImg, all GIFs tested work fine, assuming WIC was used.
-
Will check the WIC API functions, thanks.
FYI I experimented with built in GIF support but I have already disabled it again//#include <Vcl.Imaging.GIFImg.hpp> // For TGIFImage
because WIC does a better job on the images that I tested
-
Interesting, thanks @vfbb
For the time being at least I have completely disabled support for *.svg since I don't want to statically link to a third party dll.But good to know.
-
I arrived at this first iteration code:
{ String formats; static const TGraphicClass graphicClasses[] = { __classid(TBitmap), // BMP __classid(TJPEGImage), // JPG __classid(TPngImage), // PNG __classid(TMetafile), // WMF, EMF __classid(TIcon), // ICO __classid(TGIFImage), // GIF __classid(TWICImage), // TIF, TIFF }; constexpr int numClasses = sizeof(graphicClasses) / sizeof(graphicClasses[0]); for (int i = 0; i < numClasses; i++) { String mask = GraphicFileMask(graphicClasses[i]); if (!mask.IsEmpty()) { // Remove "*." from extensions mask = StringReplace(mask, L"*.", L"", TReplaceFlags() << rfReplaceAll); if (!formats.IsEmpty()) formats += L";"; formats += mask; } } return formats; }
which reliably provides me this list:
L"bmp;jpg;jpeg;png;emf;wmf;ico;gif;tif;tiff"
which I can use to decide on providing a picture for a file or not
Although I might as well hard code these since they are built in anyway
I am not seeing the @Anders Melander mentioned external WIC extensions. Any idea how to get to those ?GraphicFileMask() on the WIC class only adds tif and tif
@Remy Lebeau I suspect *.webp, just like cr2, erf, raf, 3fr, dcr, dng, mrw, nef, orf, raw, pef, srw, sr2 (and perhaps more) on my system are supported via mentioned external WIC class ?
I just need to find a way to build up a list
-
> I would also unregister the TWICImage class (see UnregisterFileFormat) as support for all the formats it support might not be a good thing. All the formats will just confuse your users.
It's not a picture viewing program as such. More of an extra feature if the functionality is available for that type picture (user needs to jump through hoops to get there).
Example:
So I will try to build a list of supported extensions on that system and use that list to make the functionality available for that file (or not) using this suggestion:> Calling GraphicFileMask(TGraphic) from Vcl.Graphics will give you a list of supported extensions.
Though I still need to figure this out ?
-
> Only when these units are used in your application the corresponding file extensions will be supported.
I seem to have support for all of them, but ok I will also explicitly include them:
#include <Vcl.Imaging.GIFImg.hpp> // *.gif #include <Vcl.Imaging.jpeg.hpp> // *.jpg, *.jpeg #include <Vcl.Imaging.pngimage.hpp> // *.png
> svg, webp and wbmp in Vcl.Skia
I have fully disabled Skia again because I don't want to statically link an extra dll
#if defined BUILD_WITH_SKIA #include <System.Skia.hpp> #include <Vcl.Skia.hpp> #endif
However *.webp works for me, loaded in TImage btw, so I don't see the relationship with Skia ?
-
Thanks guys, I'll check it out tomorrow (signing off now, down under)
> For example, include the pngimage unit for PNG support, the jpeg unit for JPEG support, etc.
Is this not implied if I use TImage ? Since it supports those formats via the different graphics classes that it supports (png, bmp, jpg, wmf, ico) -
I wish the dll would not be statically linked. That would allow inclusion of all functionality and if the dll is not present, the functionality would simply not work (similar to an unsupported file being loaded)
-
I see. I'll look into it.
And it is fully 'legal' to bundle this dll with an application ?
-
I did not deploy a dll no. The documentation did not mention the need for a dll.
Where do I find this dll ?
-
c++Builder 12.2
I finished an implementation where I load pictures from a proprietary source into a TImage instance.
Image->Picture->LoadFromStream(Stream)
This works well and during testing I found I could render following file formats without a problem on my W11 development system
bmp, jpg, png, wmf, emf, webp, gif, ico, tif, cr2, erf, raf, 3fr, dcr, dng, mrw, nef, orf, raw, pef, srw, sr2However, while testing on older OS (VM) I noticed a lot of the fancier formats above do not work.
Only the basic ones: bmp, jpg, png, wmf, emf, gif, ico and tif
1. I'm guessing TImage uses system installed resources to render images ? Which ones ? How does that work ? What do other applications install for TImage to be able to use them
2. Is there a way to get a list out of TImage that lists the supported files on the system the exe is running on ?
-
Hi, yes VCL, c++ Builder 12.2
Adding everything and making it work on my system was easy, but I did not expect the program to crash on startup on every other system I tested.It only works on my W11 development system
-
I just implemented displaying *.svg files via TSkSvg but I'm glad I fairly quickly found out that by doing so the application doesn't start anymore on all the older Windows OS (via VM).
Is there a requirement I'm not aware of ? A dependency ?
Where is this documented ?
I looked here: https://docwiki.embarcadero.com/Libraries/Athens/en/Vcl.SkiaI see no mention of dependables ? What am I missing ?
-
Thanks for the update. All I needed to know. Cheers.
-
FYI:
Using C++ Builder 12.1 I tried to compile icsv8w: IcsVclCB110Run.cbproj and IcsCommonCB110Run.cbproj which now fails
This still worked OK using C++ Builder 12
PS. I only need the run time stuff, not the design time stuff. I link to the *.hpp and *.o / *.obj files
To the point:
So I downloaded this version (9.2) and notice the packages for C++ are generic ? No version number ?
I built:
icsv92\Packages\IcsCommonCBNewRun.cbproj
icsv92\Packages\IcsVclCBNewRun.cbproj
successfully, using C++ Builder 12.1
But .. there are no *.hpp files emitted ?
Libs are created (*.o and *.obj) but they seem 'light' in number and size (not tried to link in anything yet since I don't have the *.hpp files)
No c++ support yet ?
Not to mention support for the 64 bit 'Modern' build toolset.
Set StyleName for one single control, yet no style for the rest of the app
in VCL
Posted · Edited by CyberPeter
Perhaps it's best I show what I mean.
Fairly sure nobody finds this pleasant (PS. none of this happens without a Style on the same (slow) system)