sSkinProvider.GetFormImage without border

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37916
    novel Spb
    Participant

    I'm using AlphaControls v11.22.

    I'm trying to fade main form during modal windows showing. Here's a simple demo (project for Delphi XE3 is attached):

    Code:
    procedure TForm2.bAlphaClick(Sender: TObject);
    var
    bm: TBitmap;
    begin
    bm := sSkinProvider.GetFormImage(sSkinProvider1); // <------------- one method
    SM(bm);
    end;

    procedure TForm2.bNativeClick(Sender: TObject);
    var
    bm: TBitmap;
    begin
    bm := Application.MainForm.GetFormImage; // <----------------- other method
    SM(bm);
    end;

    function TForm2.SM(bm: TBitmap): TModalResult;
    var
    pn: TPanel;
    img: TImage;
    begin
    try
    FadeBitmap(bm);

    pn := TPanel.Create(nil);
    try
    img := TImage.Create(nil);
    try
    img.Parent := pn;
    pn.BoundsRect := Application.MainForm.ClientRect;
    pn.BevelOuter := bvNone;
    img.Align := alClient;
    img.Picture.Bitmap.Assign(bm);
    pn.Parent := Application.MainForm;

    MessageDlg('Test', mtWarning, [mbOK], 0);
    finally
    img.Free;
    end;
    finally
    pn.Free;
    end;
    finally
    bm.Free;
    end;
    end;

    and result windows:

    1) the original look:

    [attachment=8866:s1.jpg]

    2) after Native button pressing

    [attachment=8867:s2.jpg]

    3) after Alpha button pressing

    [attachment=8868:s3.jpg]

    Here I have two issues:

    1. GetFormImage method of TCustom form gets client area only (this is what I need), but some Alpha controls are not drawn.

    2. GetFormImage function from sSkinProvider unit gets all form with border and menu, so I cannot use this image in my purposes.

    So my questions are:

    How I can “teach” GetFormImage function from sSkinProvider to draw client area only

    or

    How I can obtain fully drawn image with TCustomForm.GetFormImage.

    Thank you for a help.

    #58297
    Support
    Keymaster

    Hello

    Do you know about the TsSkinProvider.DisabledBlendValue property?

    This property allows to fade a form with TsSkinProvider automatically if Form.Enabled property is False.

    Maybe it's enough in your case? Otherwise, I'll try to find another solution.

    i17_12.png

    #58301
    novel Spb
    Participant

    Yes, it's exactly what I need. Thank you!

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