Symbol
The Symbol object is a graphical container that can hold either raster or vector images.
Property | Description |
---|---|
Content | Content contains child properties that define the image being displayed. |
Set this to True to cache the content in memory for quicker loading. Default: True |
|
Determines the content fill behavior. Options:
|
|
The absolute path to the content. Use this if you wanted to explicitly specify a path on the local computer through the open file dialog or similar. Format: C:/Users/<User>/Documents/content.svg |
|
Use this to specify a file in the project that should be used as the content source. See File Name information. mySymbolContent.Source = pump.bmp mySymbolContent.Source = Project_Include.Content.symbol.svg |
|
[Deprecated] | |
ContentAlignment | The alignment of the image in relation to the symbol object if no scaling is used (the image size is controlled by it's resolution). |
Padding | Image offset from the edges of the Symbol object |
Image
Images have no additional properties.
Supported Formats:
- BMP
- GIF
- JPG
- PNG
- TIFF
Additional image formats can be used, based on the installed codecs on the target computer. Compatibility is not guaranteed for other formats.
Python constructor:
myImage = Image(string path)
mySymbol = Symbol(myImage)
Vector Graphic
Property | Description |
---|---|
Content.Border | Color of the vector stroke. |
Content.BorderWeight | Thickness of the vector stroke. |
Content.Fill | Color of the vector fill. |
Supported Formats:
- SVG
Python constructor:
myVector = VectorGraphic(string path, PythonColor fill, PythonColor border, double borderWeight)
mySymbol = Symbol(myVector)
View Example
{
"$type":"Symbol",
"Name":"DuckImage",
"Width": 200,
"Height": 100,
"X": 250,
"Y":20,
"Padding":"5",
"Content":
{
"$type": "Image",
"source": "Example_Project.Content.Image.duck.jpg",
"fillMode":"FillStretch"
}
},
{
"$type":"Symbol",
"Name":"DiodeImage",
"Width": 200,
"Height": 100,
"X": 250,
"Y":320,
"Padding":"5",
"Content":
{
"$type": "VectorGraphic",
"source": "Example_Project.Content.Vector.diode.svg",
"fillMode":"StretchHorizontal",
"fill":"#00FF0000",
"border":"#0000FF",
"borderWidth":3
}
}
Python Example
from Omniview.Python import *
# Image
myImageContent = Image("Content.Image.duck.jpg")
myImage = Symbol(myImageContent)
myImage.X = 500
myImage.Y = 250
myImage.Width = 50
myImage.Height = 50
# Vector Graphic
myVectorContent = VectorGraphic("Content.Vector.diode.svg", Color("#FF0000"), Color("#000000"), 1.0)
myVector = Symbol(myVectorContent)
myVector.X = 500
myVector.Y = 300
myVector.Width = 50
myVector.Height = 50
Omniview.Windows[0].Content.AddViewObject(myImage)
Omniview.Windows[0].Content.AddViewObject(myVector)