Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • Lazarus Lazarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 2,095
    • Issues 2,095
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 8
    • Merge requests 8
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • FPC
  • Lazarus
  • LazarusLazarus
  • Issues
  • #39614
Closed
Open
Created Jan 29, 2022 by dbannon@dbannonContributor

GTK3 speedbuttons display bad images

  • Lazarus/FPC Version: lazarus_main
  • Operating System: Linux
  • CPU / Bitness: 64 (64 or 32 Bit?)

What happens

In gtk3, speedbuttons do not show their bitmaps correctly.

What did you expect

Correctly rendered bitmaps.

Steps to reproduce

Blank form, add a speedbutton, set a bitmap file and run it.

The issue was introduced in 02115d37, "LCL-GTK3: Turn WriteLn into DebugLn. Make sure they compile. Cleanup." and relates to gtk3lclintf.inc. Changes in 02115d37 enabled some extra formats but they appear to be in a different order than that defined in the bindings, gtk3bindings/lazcairo1.pas.

Around line 306 the function TGtk3WidgetSet.RawImage_DescriptionFromBitmap() should look like this -

function TGtk3WidgetSet.RawImage_DescriptionFromBitmap(ABitmap: HBITMAP; out ADesc: TRawImageDescription): boolean;
// var
//  GDIObject: PGDIObject absolute ABitmap;
const
  CairoImageFormatToDepth: array[cairo_format_t] of integer =
  (
    {CAIRO_FORMAT_INVALID}   -1,
    {CAIRO_FORMAT_ARGB32}    32,
    {CAIRO_FORMAT_RGB24}     24,
    {CAIRO_FORMAT_A8}         8,
    {CAIRO_FORMAT_A1}         1,
    {CAIRO_FORMAT_RGB16_565} 16,
    {CAIRO_FORMAT_RGB30}     15
  );  

This matter was discussed in the tail end of https://forum.lazarus.freepascal.org/index.php/topic,50400.0.html

Patch or pull request can be provided if you need it.

Davo

Assignee
Assign to
Time tracking