Difference between revisions of "TW3ControlBackground"

From Smart Mobile Studio
Jump to: navigation, search
m
 
Line 13: Line 13:
 
!Methods
 
!Methods
 
|-
 
|-
| [[File:method-icon.png|16px|link=]] [[#FromColor|FromColor]]
+
| {{Icon-method-16px-nolink}} [[#FromColor|FromColor]]
 
|-
 
|-
| [[File:method-icon.png|16px|link=]] [[#FromURL|FromURL]]
+
| {{Icon-method-16px-nolink}} [[#FromURL|FromURL]]
 
|-
 
|-
| [[File:method-icon.png|16px|link=]] [[#FromImageData|FromImageData]]
+
| {{Icon-method-16px-nolink}} [[#FromImageData|FromImageData]]
 
|-
 
|-
| [[File:method-icon.png|16px|link=]] [[#ToColor|ToColor]]
+
| {{Icon-method-16px-nolink}} [[#ToColor|ToColor]]
 
|-
 
|-
| [[File:method-icon.png|16px|link=]] [[#ToURL|ToURL]]
+
| {{Icon-method-16px-nolink}} [[#ToURL|ToURL]]
 
|}
 
|}
  
Line 27: Line 27:
 
= Methods =
 
= Methods =
 
<div id="FromColor"></div>
 
<div id="FromColor"></div>
== [[File:method-icon.png|16px|link=]] FromColor ==
+
== {{Icon-method-16px-nolink}} FromColor ==
 
Set background-color CSS attribute (backgroundColor DOM prop.) of owned object.
 
Set background-color CSS attribute (backgroundColor DOM prop.) of owned object.
  
Line 52: Line 52:
  
 
<div id="FromURL"></div>
 
<div id="FromURL"></div>
== [[File:method-icon.png|16px|link=]] FromURL ==
+
== {{Icon-method-16px-nolink}} FromURL ==
 
Set background-image CSS attribute (backgroundImage DOM prop.) of owned object.
 
Set background-image CSS attribute (backgroundImage DOM prop.) of owned object.
  
Line 76: Line 76:
  
 
<div id="FromImageData"></div>
 
<div id="FromImageData"></div>
== [[File:method-icon.png|16px|link=]] FromImageData ==
+
== {{Icon-method-16px-nolink}} FromImageData ==
  
  
 
<div id="ToColor"></div>
 
<div id="ToColor"></div>
== [[File:method-icon.png|16px|link=]] ToColor ==
+
== {{Icon-method-16px-nolink}} ToColor ==
 
Return TColor representation of background-color CSS attribute (backgroundColor DOM property).
 
Return TColor representation of background-color CSS attribute (backgroundColor DOM property).
  
Line 90: Line 90:
  
 
<div id="ToURL"></div>
 
<div id="ToURL"></div>
== [[File:method-icon.png|16px|link=]] ToURL ==
+
== {{Icon-method-16px-nolink}} ToURL ==
 
Return value of background-image CSS attribute (backgroundImage DOM property).
 
Return value of background-image CSS attribute (backgroundImage DOM property).
  

Latest revision as of 12:37, 14 September 2014


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