- This topic has 10 replies, 2 voices, and was last updated 3 years ago by Support.
-
AuthorPosts
-
November 15, 2021 at 4:34 pm #70472Koushik HalderParticipant
Is there any option to add Glyph in ExtraLineData? I have the following Code to add Glyph to ExtraLineData from sAlphaImageList1 ItemIndex[0]:
procedure TForm1.sSkinManager1GetMenuExtraLineData(FirstItem: TMenuItem; var SkinSection, Caption: string; var Glyph: TBitmap; var LineVisible: Boolean); begin if FirstItem = M1 then begin LineVisible := True; Caption := 'HorizontalMenuItem1'; sAlphaImageList1.GetBitMap(0, Glyph); end; end;
But no Glyph is showing in ExtraLineData.
November 18, 2021 at 6:09 am #70479SupportKeymasterHello!
Glyph should not be Nil and PixelFormat should be pf32bit, please check it.November 18, 2021 at 7:33 pm #70490Koushik HalderParticipantWhat you have mentioned, already there but not working. It will be better if you provide a DEMO.
November 19, 2021 at 6:27 am #70492SupportKeymasterThis Glyph is nil when event occurs.
If Glyph must be used then developer should create it here.
The GetBitMap procedure doesn’t create an image, you can use the sAlphaImageList1.CreateBitmap32 function.November 19, 2021 at 5:36 pm #70493Koushik HalderParticipantThe Image is stored in sImageList1. The Image Index is = 0. As per your suggestion I have added the following code:
procedure TForm1.sSkinManager1GetMenuExtraLineData(FirstItem: TMenuItem; var SkinSection, Caption: string; var Glyph: TBitmap; var LineVisible: Boolean); begin if FirstItem = MenuItem1 then begin LineVisible := True; Caption := 'HorizontalMenuItem1'; sAlphaImageList1.CreateBitmap32(1, 20, 20, 20); end; end;
But no Glyph is shown in ExtraLineData. Please provide one DEMO.
- This reply was modified 3 years ago by Koushik Halder.
November 19, 2021 at 6:26 pm #70497Koushik HalderParticipantUsing the following code from ASLDemo the glyph is created:
Glyph := TBitmap.Create; // Prepare Transparent Background Glyph.Canvas.Brush.Color := clFuchsia; Glyph.Canvas.FillRect(Rect(0, 0, Glyph.Width, Glyph.Height)); Glyph.Transparent := true; // Receiving From ImageList sAlphaImageList1.DrawingStyle := dsTransparent; sAlphaImageList1.GetBitmap(1, Glyph);
But the Image quality gets distorted.
The Image 00001.pngbecomes 00002.png
instead of 00003.png
How to improve the quality.
Attachments:
You must be logged in to view attached files.November 20, 2021 at 7:07 am #70501Koushik HalderParticipantWhy the code
Glyph := TBitmap32.Create;
does not work?November 21, 2021 at 11:16 am #70504SupportKeymasterBut no Glyph is shown in ExtraLineData. Please provide one DEMO.
Demo of ExtrLine may be found in the ASkindemo.
Look this procedure there:procedure TMainForm.sSkinManager1GetMenuExtraLineData(FirstItem: TMenuItem; var SkinSection, Caption: string; var Glyph: TBitmap; var LineVisible: Boolean);
The glyph may be invisible if AlphaChannel exists there but empty (glyph is drawn as fully transparent in this case).
November 21, 2021 at 2:07 pm #70505SupportKeymasterBut the Image quality gets distorted.
Try to make new glyph with size of ImageList, which result will be?November 22, 2021 at 5:59 am #70509Koushik HalderParticipantI have already done but the result is the same. I think the problem is due to the 32Bit image conversion to 24Bit.
How to useTBitmap32.Create;
I have just uploaded my project. Please see.Attachments:
You must be logged in to view attached files.November 24, 2021 at 2:50 pm #70527SupportKeymasterThank you. Try this:
procedure TForm1.sSkinManager1GetMenuExtraLineData(FirstItem: TMenuItem; var SkinSection, Caption: string; var Glyph: TBitmap; var LineVisible: Boolean); begin Glyph := TBitmap.Create; Glyph.Width := sAlphaImageList1.Width; Glyph.Height := sAlphaImageList1.Height; sAlphaImageList1.GetBitmap32(0, Glyph); end;
If you make pf24bit, then transparent part is lost.
-
AuthorPosts
- You must be logged in to reply to this topic.