TW3ControlBackground
Unit: SmartCL.Components.pas
- Hierarchy
- TObject
- TW3OwnedObject
- TW3ControlBackground
- TW3OwnedObject
Methods |
---|
FromColor |
FromURL |
FromImageData |
ToColor |
ToURL |
Methods
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>
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>
FromImageData
ToColor
Return TColor representation of background-color CSS attribute (backgroundColor DOM property).
function ToColor: TColor;
See also: FromColor
ToURL
Return value of background-image CSS attribute (backgroundImage DOM property).
function ToURL: String;
See also: FromURL