Android instance-trectangle loading picture (xe8+ Xiaomi 2)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.