Kobus Vdwalt
Kobus Vdwalt

Reputation: 347

How to set a Timage wrapmode in delphi through code?

(Using firemonkey and xe3). Hi i create a img.

  img := Timage.Create(fsbCanvas);
  with img do
    begin
      Parent:=fsbCanvas;
      position.X:=frmMainUI.CurrentMouseX;
      position.y:=frmMainUI.CurrentMouseY;
      Bitmap.LoadFromFile('1.jpg');
      Visible:=true;
    end;

And now i want to set its wrapmode to iwStreach. so i add this : Timagewrapmode.iwStreach but i get an error saying "statement expected but expression found".

Can anybody help?

Upvotes: 0

Views: 1718

Answers (1)

LU RD
LU RD

Reputation: 34899

You have to set the image WrapMode property this way:

img.WrapMode := TImageWrapMode.iwStretch;

Note, the enumeration must be fully qualified with it's type name.

This is because the compiler directive "$SCOPEDENUMS" is on by default in FireMonkey applications.

Upvotes: 6

Related Questions