TTMSFNCBitmapContainer and procedure AddFromResource();

OS: Debian 10 (buster) LXDE
fpc 3.3.1
lazaraus 2.1

component: TTMSFNCBitmapContainer

Can you make an example of how to use

whether it is used
.lrs or .dcr
.png or .bmp


When you are including a resource file, which has resources defined with the RT_RCDATA define, you can use the AddFromResource that is based on the name of the resource.

It fails me;
I don't seem to use it well.





bc:= TTMSFNCBitmapContainer.Create(Self);
bc.AddFromResource('ZCRibbonToolBarDBNavigator.lrs', 'TZCRIBBONDBNAVIGATORADD.PNG');
BitmapContainer := bc;

FAdd := AddButton(24, 24, res, res+'LARGE');
FAdd.AllowFocus := False;
FAdd.ShortCutHint := 'A';
FAdd.AutoOptionsMenuText := 'Add';
FAdd.Stored := False;
FAdd.OnClick := @DataSetAdd;


Please read

This way I managed to get a picture:

When I run the program and bring the mouse, the image disappears.

We have tested this here and could not reproduce the issue. Please first read the link above and see how you can add bitmaps from resources. The code is working as expected.

Button01 Button02

Did you add an item to the HoverBitmaps collection?

Thank you,
That solved the problem.
Not add HoverBitmaps

1 Like

Thank you for the feedback!

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.