Polygon Background - Forum

Forum Navigation
You need to log in to create posts and topics.

Polygon Background

Hy,

my first steps with NBWeb . I try to fill at Polygon with color, when button klick.

I tried this code (from documentation) but doesn´t work...

neoBackgroundColor [Polygon1] [green]

Can someone give me a hint ?

 

@gremlin

Good time!

Pay attention to the syntax of the command in the help:

https://webhelp.visualneo.com/neoBackground.html

@gremlin

You can also use SetObjectStyle, which allows you to change and set an individual CSS style for an object.

Create the polygon with ID "MyPoly", add Fill "#008B0E" or any colour.

Then add the following on click:

SetObjectStyle "MyPoly" "fill" "#FF8B0E"

The Polygon will change From Green to Orange when clicked on.

@paultomo: Thanks, this work but

@Vadmin: I had tried with Picture (neoBackgroundImage) and Color (neoBackgroundColor) but the command still black , not changing to blue and it doesn`t work. Error message. Why this Plugin don´t work ?

@gremlin

Yes, these commands are not recognized in the new version. Judging by the list of plug-ins, neoBackground is not included in the compiled version. Therefore, the commands of this plugin are not recognized by VisualNEO Web.

I will mark the login of Luis (@luishp) so that he will pay attention to this topic.

 

@gremlin @vadim please download and install the attached plugin.
It seems I forgot to include it within the installer. I have already fixed it :)
Thank you!

Uploaded files:
  • You need to login to have access to uploads.
Vadim has reacted to this post.
Vadim

@luishp: Thank you, it work a little bit better but now it fill not the Polygon. The Space around the Polygon are filled. My Sample I tried to fill the yellow with orange:

Code: neoBackgroundColor "Polygon1" "#ee7752"

Uploaded files:
  • You need to login to have access to uploads.

@gremlin

This is how it should be, because the neoBackground plugin works with the background.

To change the Polygon object's fill, insert a variable instead of the color name in the object's properties and apply the SetVar command.

For example:

SetVar [PolygonColor] "#FD5308"

Uploaded files:
  • You need to login to have access to uploads.

@gremlin neoBackground is intended to work (mainly) on Container objects.
Polygons are inline SVG's so you will need an alternative method:

SetObjectStyle "MyPoly" "fill" "#FF8B0E"

Or using a variable as a property value, as @vadim suggest.

Regards.

Hy, thank you very much. Now it work´s

Can I add with this command a picture to this Polygon too ?

I had tried:

SetObjectStyle "MyPoly" "fill" "e:\Download\123.jpg"

or

SetObjectStyle "MyPoly" "fill" "E./Download/123.jpg"

or via Website:

SetObjectStyle "MyPoly" "fill" "http://test.de/123.jpg"

 

@gremlin, you can do it but you need to define the background as a SVG pattern first (add it as HTML into a Container). Take a look here:

https://stackoverflow.com/questions/3796025/fill-svg-path-element-with-a-background-image

Regards.

Sorry , I tried to understand, but I can´t.

I had tried varius , but I don´t know how to define the background as SVG pattern.

Code:

SetObjectStyle "Rueckenteil" "content" "<defs><pattern id='img1' patternUnits='userSpaceOnUse' width='100' height='100'><image href='c:\Users\StrandkorbKing\Downloads\schirmstaender_0106140-000_m.jpg' x='0' y='0' width='100' height='100'/></pattern>"

Rueckenteil are a Polygon

I think my code absolute a fail ... (but I can´t find a sample or I don´t understand how to do that)

@gremlin please check the attached app. Note that I have used a remotely hosted image. Local absolute paths can cause problems once the application is compiled and published somewhere if you don't understand how paths work. Try using relative paths instead.

Regards.

Uploaded files:
  • You need to login to have access to uploads.

Thank you very much, now I´m can go on with my app.