- Empezar
- Crear proyectos
- OPC UA
- Objetos gráficos
- Objetos gráficos predefinidos
- Sesiones y configuraciones regionales
- Referencias de objetos y variables
- Extensión de proyectos
- NetLogic
- Referencia de API de C#
- Tutoriales
- Tutorial de alarmas
- Tutorial sobe objetos gráficos
- Tutorial del registrador
- Tutorial de NetLogic
- Tutorial de OPC UA
Crear NetLogic para modificar la imagen
Requisitos previos
Establezca el editor de código externo predeterminado. Consulte Establecer el editor de código predeterminado.
- Para crear NetLogic para ocultar la imagen
- EnVista del proyecto, haga clic con el botón derecho enMainWindow (type)y seleccione .
- Haga doble clic en NetLogic.Se abre el editor de código externo.
- Para editar NetLogic, reemplácelo por el código siguiente. Consulte Editar un NetLogic.#region Using directives using FTOptix.NetLogic; using FTOptix.UI; #endregion public class RuntimeNetLogic1 : BaseNetLogic { public override void Start() { // Insert code to be executed when the user-defined logic starts } public override void Stop() { // Insert code to be executed when the user-defined logic is stopped } [ExportMethod] public void replaceSVG() { // LogicObject.Owner is the button, so LogicObject.Owner is the MainWindow AdvancedSVGImage svgImage = LogicObject.Owner.Children.Get<AdvancedSVGImage>("AdvancedSVGImage1"); string myXML = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\r\n<svg version=\"1.1\" id=\"Overall\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xml:space=\"preserve\" viewBox=\"0 0 300 300\">\r\n <g id=\"Box1\">\r\n <polygon style=\"fill:#CB8252;\" points=\"25,270 75,270 75,220 25,220\" transform=\"rotate(0, 20, 20)\"/>\r\n </g>\r\n</svg>\r\n"; //Update the SVG svgImage.SetImageContent(myXML); } }
- Guarde el código.
Entregue su opinión