Domus
Domus

Reputation: 1279

MakeScreenshot not rendered correctly when effect applied

Any way around this?

When I put a TRectangle with a TBlurEffect inside a TLayout, and next to it a TImage (with WrapMode iwOriginal), then assign the bitmap result of a Layout1.MakeScreenshot to the image's bitmap, the stroke of the rectangle is painted unblurred (but the blur effect outside the stroke is still visible).

The form

procedure TForm7.Button1Click(Sender: TObject);
begin
  Image1.Bitmap := Layout1.MakeScreenshot
end;

enter image description here

Any way to make this function as desired?

Upvotes: 2

Views: 204

Answers (1)

Tom Brunberg
Tom Brunberg

Reputation: 21045

Use the ProcessEffect procedure of the effect on the image after assigning the screenshot:

procedure TForm3.Button1Click(Sender: TObject);
begin
  Image1.Bitmap := Layout1.MakeScreenshot;
  BlurEffect1.ProcessEffect(Image1.Bitmap.Canvas, Image1.Bitmap, 1);
end;

enter image description here

Upvotes: 2

Related Questions