Jump to content

Carlo Barazzetta

Members
  • Content Count

    39
  • Joined

  • Last visited

  • Days Won

    5

Carlo Barazzetta last won the day on July 23 2021

Carlo Barazzetta had the most liked content!

Community Reputation

85 Excellent

About Carlo Barazzetta

  • Birthday 02/12/1968

Technical Information

  • Delphi-Version
    Delphi 10.4 Sydney

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Carlo Barazzetta

    Looking for SVG support in Delphi?

    News on the latest versions of SVGIconImageList components: The library now also supports the SKIA4Delphi SVG engine, but Image32 remains the best library for SVG rendering for complex files, as you can see in SVGViewerDemo. Cairo support has been removed.
  2. Carlo Barazzetta

    Looking for SVG support in Delphi?

    In the last version, 3.9.1 on GitHub Repo (https://github.com/EtheaDev/SVGIconImageList), I've added support for Delphi 10 Seattle (only VCL).
  3. Carlo Barazzetta

    Delphi compatibility with Windows 11?

    At the moment I've resolved in this way the bad painting of DbGrid: procedure TForm1.DbGridDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var LDbGrid: TDbGrid; begin LDbGrid := Sender as TDbGrid; //Resolve bad painting of selected cell in Windows 11 if not StyleServices.Enabled or (StyleServices.IsSystemStyle) then begin if ((gdSelected in State) and (gdFocused in State)) or ((gdSelected in State) and (dgRowSelect in LDbGrid.Options) and LDbGrid.Focused) then LDbGrid.Canvas.Brush.Color := clHighlight; LDbGrid.DefaultDrawColumnCell(Rect, DataCol, Column, State); end; end;
  4. Carlo Barazzetta

    Delphi compatibility with Windows 11?

    Typically, any Delphi app runs smoothly on Windows 11 (I've been using W11 since June). Using an application with native Windows Style, the main differences I found are visible in this form: The window and even the menu have rounded corners The menuitem selected has rounded corners and a smaller area of drawing The major problem is visible in the selected cell of a DbGrid: a strange rectangular and a rounded focused box: very bad to see. If an edit has Ctl3D it works like default in W11: only the bottom border is visible (and colored): when the input receive focus the bottom border gets thicker Selected RadioGroup has a colored border instead of a dot inside. Scrollbars are thiny and enlarged when focused. Buttons are rounded Using a Styled app, all of those problem disappear, but it would be useful to have styles that look like Windows 11, just as Windows 10 styles were created (I hope in the next Delphi 11 release).
  5. Carlo Barazzetta

    Looking for Icon Fonts support in Delphi for High-DPI and Themed app?

    I didn't understand what you mean... I am using "fonts of icons" to draw bitmaps in an ImageCollection / ImageList, to get scaled images for any DPI... I am using GDI + for best performance and transparency support ... If the font is already installed in the system it works fine, the problem is only when deploying an application without installing the font during setup: only in this case the application must load and add the font at startup, before use it to draw bitmaps, but I don't know why I need to add a sleep 😞
  6. Carlo Barazzetta

    Looking for Icon Fonts support in Delphi for High-DPI and Themed app?

    After several attempts we found these problems: 1) after calling AddFontResource and notified in windows that a font has been added calling SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0); the application hangs for several seconds waiting for all processes to respond to the message... 😞 Using PostMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0); instead of SendMessage does not hang. https://social.msdn.microsoft.com/Forums/en-US/6900f74f-6ece-47da-88fc-f9c8bcd40206/sendmessage-api-slow?forum=wpf 2) In any case the imagelist does not draw icons correctly when it is using GDI+: only by adding a sleep (500) you get the correct drawing of the icons. It seems that calling AddFontResource does not immediately update the list of fonts available to GDI+ For now the solution is to "wait" 500 millisecond at startup application after adding font loaded from disk: AddFontResource(PWideChar(FFontFileName)); PostMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0); //Wait for Font available on GDI+ collection for drawing... Sleep(500); But is not an elegant solution... Any idea? Another article with similar problem: https://www.vbforums.com/showthread.php?883637-GDI-problems-with-GdipCreateFontFamilyFromName
  7. Carlo Barazzetta

    Looking for Icon Fonts support in Delphi for High-DPI and Themed app?

    When starts, the demo looks for the font installed into Windows: if not try loading from disk in this event of the datamodule: procedure TdmImages.IconFontsImageCollectionFontMissing( const AFontName: TFontName); var LFontFileName: string; begin inherited; //The "material desktop font is not installed into system: load and install now from disk LFontFileName := ExtractFilePath(ParamStr(0))+'..\Fonts\Material Design Icons Desktop.ttf'; if FileExists(LFontFileName) then begin {$IFNDEF D2010+} AddFontResource(PChar(LFontFileName)); {$ELSE} AddFontResource(PWideChar(LFontFileName)); {$ENDIF} SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0); end else begin //If the font file is not available raise Exception.CreateFmt('Warning: "%s" font is not present in your system!'+sLineBreak+ 'Please download at https://materialdesignicons.com and install it, because this demo is based on this font.', [AFontName]); end; end; If the call to AddFontResource fails on your machine I don't known why... please use the issue section of the project to continue discussion... https://github.com/EtheaDev/IconFontsImageList/issues Another reason could be that the font is installed only as resource of the IDE: I reccommend to install it manually in the developer machine as system font. bye Carlo
  8. Carlo Barazzetta

    Looking for SVG support in Delphi?

    Good news about 2.4.0 version of SVGIconImageList: - Added new engine: Image32 library (ver.3.0) by Angus Johnson (VCL+FMX) - Image32 is now the default native Delphi engine, because has more SVG functionalities like blur, gradient, merge, drop-shadow, markers, simbol, pattern, subpixel. - Added support for Android and iOS platforms (by Image32 engine) - Added support for backward Delphi versions (from XE3) - Added demo to compare the four engines (SVGViewer)
  9. Carlo Barazzetta

    A BIG and very strange BUG with High-DPI, VCL Style and Form Constraints

    I've created the BUG report: https://quality.embarcadero.com/browse/RSP-33760 Please vote for it. bye Carlo
  10. Carlo Barazzetta

    A BIG and very strange BUG with High-DPI, VCL Style and Form Constraints

    No, I haven't reported the BUG yet, I was hoping to be able to find the problem and also provide a possible solution ...
  11. Carlo Barazzetta

    A BIG and very strange BUG with High-DPI, VCL Style and Form Constraints

    At the moment I've resolved rewriting WMGetMinMaxInfo handler using other variables (MinFormWidth, MinFormHeight, MaxFormWidth, MaxFormHeight: Integer;) into my base form of the application. procedure TBaseForm.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); var LMinMaxInfo: PMinMaxInfo; begin if not (csReading in ComponentState) then begin LMinMaxInfo := Message.MinMaxInfo; with LMinMaxInfo^ do begin with ptMinTrackSize do begin if MinFormWidth > 0 then X := MinFormWidth; if MinFormHeight > 0 then Y := MinFormHeight; end; with ptMaxTrackSize do begin if MaxFormWidth > 0 then X := MaxFormWidth; if MaxFormHeight > 0 then Y := MaxFormHeight; end; ConstrainedResize(ptMinTrackSize.X, ptMinTrackSize.Y, ptMaxTrackSize.X, ptMaxTrackSize.Y); end; end; inherited; end;
  12. Carlo Barazzetta

    A BIG and very strange BUG with High-DPI, VCL Style and Form Constraints

    But in my configuration the primary monitor is monitor 1 with 96 DPI, the application is on monitor 1 (the primary) and the bug is present also on primary monitor.
  13. Carlo Barazzetta

    A BIG and very strange BUG with High-DPI, VCL Style and Form Constraints

    Zip of Project and video demo. HighDPI_test.mp4 HighDPI-test.7z
  14. Carlo Barazzetta

    A BIG and very strange BUG with High-DPI, VCL Style and Form Constraints

    Thanks for the test, I've changed my secondo monitor to 144dpi but the problem is the same... I've upgraded my Windows10 version to 20H2 build but the problem still persist...
  15. Carlo Barazzetta

    A BIG and very strange BUG with High-DPI, VCL Style and Form Constraints

    It's not a configuration problem because the application starts with correct DPI. At the first Minimize/Maximize receive a wrong DPI (the DPI of the secondary monitor), at the second Minimize/Maximize receive the correct DPI, and so on. But this appens ONLY if I'm using a VCLStyle and I have defined min constraint for the form and the current WindowsState is wsMaximized.
×