ExtraLineData Glyph

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #70472
    Koushik Halder
    Participant

    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.

    #70479
    Support
    Keymaster

    Hello!
    Glyph should not be Nil and PixelFormat should be pf32bit, please check it.

    #70490
    Koushik Halder
    Participant

    What you have mentioned, already there but not working. It will be better if you provide a DEMO.

    #70492
    Support
    Keymaster

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

    #70493
    Koushik Halder
    Participant

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

    #70497
    Koushik Halder
    Participant

    Using 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.png

    becomes 00002.png

    instead of 00003.png

    How to improve the quality.

    Attachments:
    You must be logged in to view attached files.
    #70501
    Koushik Halder
    Participant

    Why the code Glyph := TBitmap32.Create; does not work?

    #70504
    Support
    Keymaster

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

    #70505
    Support
    Keymaster

    But the Image quality gets distorted.
    Try to make new glyph with size of ImageList, which result will be?

    #70509
    Koushik Halder
    Participant

    I have already done but the result is the same. I think the problem is due to the 32Bit image conversion to 24Bit.
    How to use TBitmap32.Create;
    I have just uploaded my project. Please see.

    Attachments:
    You must be logged in to view attached files.
    #70527
    Support
    Keymaster

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

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.