Results:
1. Loading the picture is very smooth, can do background use.
2. It is now loaded with a normal shape and a circle, other shapes can not load it? Test yourself Oh, more hands-on.
3. You need to hit the picture in the bag Oh (path is "assets\internal\").
Instance code:
1 UnitUnit1;2 3 Interface4 5 uses6 system.sysutils, System.types, System.uitypes, system.classes, System.variants,7 FMX. Types, FMX. Controls, FMX. Forms, FMX. Graphics, FMX. Dialogs, FMX. Objects,8 FMX. Controls.presentation, Fmx.stdctrls;9 Ten type OneTForm1 =class(Tform) A Button1:tbutton; - Rectangle1:trectangle; - Label1:tlabel; the Ellipse1:tellipse; - Button2:tbutton; - Label2:tlabel; - procedureButton1Click (sender:tobject); + procedureButton2click (sender:tobject); - Private + {Private Declarations} A Public at {Public Declarations} - End; - - var - Form1:tform1; - in Implementation - uses toSystem. Ioutils;//need to introduce + {$R *.FMX} - {$R *. NMXHDPIPH.FMX ANDROID} the * procedureTform1.button1click (sender:tobject); $ beginPanax NotoginsengRectangle1.width: =144; -Rectangle1.height: =144; theRectangle1.Stroke.Kind: = Tbrushkind.bknone;//border type, none +Rectangle1.Fill.Kind: = Tbrushkind.bkbitmap;//fill type, picture ARectangle1.Fill.Bitmap.WrapMode: = Twrapmode.wmtilestretch;//Stretch theRectangle1.Fill.Bitmap.Bitmap.LoadFromFile (Tpath.combine (Tpath.getdocumentspath,'144.jpg')); + End; - $ procedureTform1.button2click (sender:tobject); $ begin -Ellipse1.width: =144; -Ellipse1.height: =144; theEllipse1.Stroke.Kind: = Tbrushkind.bknone;//border type, none -Ellipse1.Fill.Kind: = Tbrushkind.bkbitmap;//fill type, pictureWuyiEllipse1.Fill.Bitmap.WrapMode: = Twrapmode.wmtilestretch;//Stretch theEllipse1.Fill.Bitmap.Bitmap.LoadFromFile (Tpath.combine (Tpath.getdocumentspath,'144.jpg')); - End; Wu - End.
Android instance-trectangle loading picture (xe8+ Xiaomi 2)