Jump to content

CyberPeter

Members
  • Content Count

    79
  • Joined

  • Last visited

Posts posted by CyberPeter


  1. On 4/5/2025 at 10:24 AM, Brian Evans said:

    Don't forget the difference between a user trying to get work done in an application vs a developer playing/scrolling around. I find a modern styled application can be easier for a user to read and follow as they work on the content shown in the application. Some appreciate being able to adjust things to their taste - especially older workers desiring larger fonts and more contrast. Users rarely dynamically resize forms these days - either it is full screen or snapped to half a screen or some other region. 

     

    I have gotten distracted working on things that seemed important - speed while users really wanted predictability. For example a form frozen for 4 seconds feels worse to a user than an active form showing progress that takes 15 seconds. When developing I might scroll through 1000's of records while a user is more likely to search and display 10-100 records and examine them when actually doing work.L

    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)

     


  2. 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. 

     


  3. 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


  4. 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 ?


  5. 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.

    • Like 1

  6. 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
     

     


  7. >  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:
    484459649_1169633201837469_4118504129773509274_n.thumb.jpg.1f3418dc066ede8f4ffba266ec08c166.jpg


    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 ?


  8. >  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 ?


  9. 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)


  10. 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)


  11. 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, sr2

     

    However, 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 ?


  12. 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


  13. 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.

     

×