TW3ControlBackground

From Smart Mobile Studio
Revision as of 09:15, 17 July 2014 by Bear (Talk | contribs)

Jump to: navigation, search


Unit: W3Components.pas


Hierarchy
TObject
TW3OwnedObject
TW3ControlBackground
Methods
Method-icon.png FromColor
Method-icon.png FromURL
Method-icon.png FromImageData
Method-icon.png ToColor
Method-icon.png ToURL


Methods

Method-icon.png FromColor

Set background-color CSS attribute (backgroundColor DOM prop.) of owned object.

procedure FromColor(const aValue: TColor);

Parameters:

aValue

TColor
Color to be converted to web color format and set as background-color value.


Example:

W3Panel1.Background.FromColor(clRed);

Output:

<div id="OBJ5" class="TW3Panel" style="visibility: visible; display: inline-block; position: absolute; overflow: hidden; left: 16px; top: 56px; width: 200px; height: 80px; background-color: rgb(255, 0, 0);"></div>


Method-icon.png FromURL

Set background-image CSS attribute (backgroundImage DOM prop.) of owned object.

procedure FromURL(const aURL: String);

Parameters:

aURL

String
URL to be surrounded with url() string and set as background-image value.


Example:

W3Panel1.Background.FromURL('http://www.mysite.com/image.jpg');

Output:

<div id="OBJ5" class="TW3Panel" style="visibility: visible; display: inline-block; position: absolute; overflow: hidden; left: 16px; top: 56px; width: 200px; height: 80px; background-image: url(http://www.mysite.com/image.jpg); background-size: auto;"></div>


Method-icon.png FromImageData

Method-icon.png ToColor

Return TColor representation of background-color CSS attribute (backgroundColor DOM property).

function ToColor: TColor;


See also: FromColor


Method-icon.png ToURL

Return value of background-image CSS attribute (backgroundImage DOM property).

function ToURL: String;


See also: FromURL