
Quote from ManuGarciaEU on June 23, 2021, 2:20 pmBuenas tardes.
Tengo el siguiente código que no termina de funcionar y no entiendo el motivo:
Loop 0 31 [x]
SetVar [posicionFila] [x]*32
If [mapaFila1([x])] === 0
DrawImage "Fila01" "" "N:\NeoDarkWeb\Imagenes\casillaVacia.png" "[posicionFila]" "0" "32" "32"
EndIf
EndLoopHaciendo log, he comprobado que solo entra en el condicional cuando se cumple que mapaFila1(x) vale 0. mapaFila1 es un array con 32 elementos, solo hay 0 en alguno de los elementos.
Fila01 es un objeto contenedor de 32px por 1024px.
El primer cuadro de 32x32 me lo dibuja siempre, pero el resto no. La variable posicionFija compruebo en el Log que se incrementa correctamente... es decir, primero vale 0, luego 32, luego 64, etc...
¿Por qué no imprime el resto?
Buenas tardes.
Tengo el siguiente código que no termina de funcionar y no entiendo el motivo:
Loop 0 31 [x]
SetVar [posicionFila] [x]*32
If [mapaFila1([x])] === 0
DrawImage "Fila01" "" "N:\NeoDarkWeb\Imagenes\casillaVacia.png" "[posicionFila]" "0" "32" "32"
EndIf
EndLoop
Haciendo log, he comprobado que solo entra en el condicional cuando se cumple que mapaFila1(x) vale 0. mapaFila1 es un array con 32 elementos, solo hay 0 en alguno de los elementos.
Fila01 es un objeto contenedor de 32px por 1024px.
El primer cuadro de 32x32 me lo dibuja siempre, pero el resto no. La variable posicionFija compruebo en el Log que se incrementa correctamente... es decir, primero vale 0, luego 32, luego 64, etc...
¿Por qué no imprime el resto?
Quote from Gaev on June 23, 2021, 6:43 pm@manugarciaeu
Row01 is a 32px by 1024px container object.
Is that 32px wide and 1024px high ?
The first 32x32 frame always draws it to me, but the rest does not
This would be the result if the container was indeed 32px wide.
Try and(temporarily) add (just before the DrawImage command), either an AlertBox or a ConsoleLog command that shows the value of variable [positionFila]; tell us if it is showing expected values for the X co-ordinate.
Also, check the Console Log to see if there are other (unexpected error) messages.
Row01 is a 32px by 1024px container object.
Is that 32px wide and 1024px high ?
The first 32x32 frame always draws it to me, but the rest does not
This would be the result if the container was indeed 32px wide.
Try and(temporarily) add (just before the DrawImage command), either an AlertBox or a ConsoleLog command that shows the value of variable [positionFila]; tell us if it is showing expected values for the X co-ordinate.
Also, check the Console Log to see if there are other (unexpected error) messages.

Quote from ManuGarciaEU on June 23, 2021, 8:14 pm@gaev, thanks.
Yes, [posicionFila] shows the correct value. First is 0, then 32, then 64...
Fila01 has 32px high and 1024 width.
@gaev, thanks.
Yes, [posicionFila] shows the correct value. First is 0, then 32, then 64...
Fila01 has 32px high and 1024 width.
Quote from Gaev on June 23, 2021, 11:56 pm@manugarciaeu
I tried this code ...
SetVar [pictureFile] "file://C:/Users/Gaev Keeka/Pictures/crab.png" Loop 0 31 [x] SetVar [posicionFila] [x]*32 ...If [mapaFila1([x])] === 0 DrawImage "Fila01" "" "[pictureFile]" "[posicionFila]" "0" "32" "32" ...EndIf EndLoop
... and it drew 32 images (even going past the right edge of Fila01).
Note that ...
a) I commented out the If/Endif commands because I was not sure how you created [mapaFila1([x])]; in order to see if this variable is the root cause, do the same in your App
b) I can not tell what kind of object Fila01 is; I spent a lot of time when I used a Container object (error messages in Inspect >> Console that I could not decipher), but when I changed it to a Rectangle object, it worked like a charm.
I tried this code ...
SetVar [pictureFile] "file://C:/Users/Gaev Keeka/Pictures/crab.png"
Loop 0 31 [x]
SetVar [posicionFila] [x]*32
...If [mapaFila1([x])] === 0
DrawImage "Fila01" "" "[pictureFile]" "[posicionFila]" "0" "32" "32"
...EndIf
EndLoop
... and it drew 32 images (even going past the right edge of Fila01).
Note that ...
a) I commented out the If/Endif commands because I was not sure how you created [mapaFila1([x])]; in order to see if this variable is the root cause, do the same in your App
b) I can not tell what kind of object Fila01 is; I spent a lot of time when I used a Container object (error messages in Inspect >> Console that I could not decipher), but when I changed it to a Rectangle object, it worked like a charm.

Quote from luishp on June 24, 2021, 7:03 am@gaev @manugarciaeu please note that Drawing commands are drawn using SVG. You need a previous SVG to draw in: a Rectangle or another inline SVG (svg code with an ID inside a Container). I hope it helps.
Regards.
@gaev @manugarciaeu please note that Drawing commands are drawn using SVG. You need a previous SVG to draw in: a Rectangle or another inline SVG (svg code with an ID inside a Container). I hope it helps.
Regards.

Quote from ManuGarciaEU on June 24, 2021, 1:44 pmThanks.
I'll try it this afternoon. Another question ... I am creating my own SVG graphics, how can I make those graphics appear in the available graphics dropdown when I insert an SVG icon in my App?
Thanks again.
Thanks.
I'll try it this afternoon. Another question ... I am creating my own SVG graphics, how can I make those graphics appear in the available graphics dropdown when I insert an SVG icon in my App?
Thanks again.
Quote from Gaev on June 24, 2021, 3:34 pm@luishp:
please note that Drawing commands are drawn using SVG. You need a previous SVG to draw in: a Rectangle or another inline SVG (svg code with an ID inside a Container).
I was able to use DrawImage with a .png file; also, the Help file here ... https://webhelp.visualneo.com/Drawing.html ... says ...
DrawImage
Purpose: Draw an image from an external source file (.svg .jpg or .png)
@luishp:
please note that Drawing commands are drawn using SVG. You need a previous SVG to draw in: a Rectangle or another inline SVG (svg code with an ID inside a Container).
I was able to use DrawImage with a .png file; also, the Help file here ... https://webhelp.visualneo.com/Drawing.html ... says ...
DrawImage
Purpose: Draw an image from an external source file (.svg .jpg or .png)

Quote from luishp on June 24, 2021, 3:50 pmI was able to use DrawImage with a .png file;
Yes @gaev, you are right, but I mean the destination object not the source file.
I was able to use DrawImage with a .png file;
Yes @gaev, you are right, but I mean the destination object not the source file.

Quote from ManuGarciaEU on June 24, 2021, 8:53 pmAnd what about this?
I am creating my own SVG graphics, how can I make those graphics appear in the available graphics dropdown when I insert an SVG icon in my App?
Another question:
I have an svg icon on top of another svg icon. Is there a way to "work" with the events of the icon below, the icon behind at the bottom?
Thanks.
And what about this?
I am creating my own SVG graphics, how can I make those graphics appear in the available graphics dropdown when I insert an SVG icon in my App?
Another question:
I have an svg icon on top of another svg icon. Is there a way to "work" with the events of the icon below, the icon behind at the bottom?
Thanks.

Quote from luishp on June 25, 2021, 7:02 amI am creating my own SVG graphics, how can I make those graphics appear in the available graphics dropdown when I insert an SVG icon in my App?
@manugarciaeu sorry, that's not currently possible.
I have an svg icon on top of another svg icon. Is there a way to "work" with the events of the icon below, the icon behind at the bottom?
I don't understand your question. Why not?
Perhaps you can find usefull this Video Tutorial about working with SVG graphics within VisualNEO Web:https://www.youtube.com/watch?v=czfLxAqFz0k
I am creating my own SVG graphics, how can I make those graphics appear in the available graphics dropdown when I insert an SVG icon in my App?
@manugarciaeu sorry, that's not currently possible.
I have an svg icon on top of another svg icon. Is there a way to "work" with the events of the icon below, the icon behind at the bottom?
I don't understand your question. Why not?
Perhaps you can find usefull this Video Tutorial about working with SVG graphics within VisualNEO Web: