Re: SVG add object question

2017-10-24 Thread Ortwin Zillgen via 4D_Tech
> A nice solution!  Just to be sure, it was to use ".svg" rather than "svg"?

added some pictures for comparison



Regards
O r t w i n  Z i l l g e n
-
   
 
member of developer-network 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: SVG add object question

2017-10-23 Thread Keith Culotta via 4D_Tech
  // A heads up about embedding a SVG area into another SVG area.
  // Getting the ID of the embedded object requires SVG Find element IDs by rect
  // It does not seem to work using SVG Find element ID by coordinates

$svg:=SVG_New 
$svgArea:=SVG_New 

SVG_New_text ($svg;"This is a test";10;10)
$interPicture:=SVG_Export_to_picture ($svg)
$svgPictureRef:=SVG_New_embedded_image ($svgArea;$interPicture;5;0;".svg")
SVG_SET_ID ($svgPictureRef;"SVG_Codec")

SVG_CLEAR ($svg)

$PicMain:=SVG_Export_to_picture ($svgArea)
SVG_CLEAR ($svgArea)

ARRAY TEXT($a_GetsOneID;0)
SVG Find element IDs by rect($PicMain;5;0;1;1;$a_GetsOneID)
$ID_IsEmpty:=SVG Find element ID by coordinates($PicMain;6;1)

ALERT("SVG Find element IDs by rect gets ="+$a_GetsOneID{1}+Char(13)+"SVG Find 
element ID by coordinates ="+$ID_IsEmpty)


// Keith - CDI

> On Oct 22, 2017, at 3:16 PM, Ortwin Zillgen via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> this works for me
> 
> 
> 
> 
> Regards
> O r t w i n  Z i l l g e n
> -
>    
>  
> member of developer-network 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: SVG add object question

2017-10-22 Thread Keith Culotta via 4D_Tech
A nice solution!  Just to be sure, it was to use ".svg" rather than "svg"?

$svgPictureRef:=SVG_New_embedded_image 
($svgCopyrightLayer_Ref;$interPicture;5;0;“.svg“)
rather than
$svgPictureRef:=SVG_New_embedded_image 
($svgCopyrightLayer_Ref;$interPicture;5;0;“svg“)


As displayed in the web page:
Next I tried the defined codec-option „svg“
$svgPictureRef:=SVG_New_embedded_image 
($svgCopyrightLayer_Ref;$interPicture;5;0;“svg“)  // appears the same
to no avail.

Finally I checked my manual of the source. Actually codec means extension, ergo 
„.svg“. This line of code
$svgPictureRef:=SVG_New_embedded_image 
($svgCopyrightLayer_Ref;$interPicture;5;0;“svg“)  // appears the same
delivers what I was looking for: 4D renders SVG inside SVG perfectly well.


Keith - CDI

> On Oct 22, 2017, at 3:16 PM, Ortwin Zillgen via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> this works for me
> 
> 
> 
> 
> Regards
> O r t w i n  Z i l l g e n

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: SVG add object question

2017-10-22 Thread Ortwin Zillgen via 4D_Tech
this works for me




Regards
O r t w i n  Z i l l g e n
-
   
 
member of developer-network 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: SVG add object question

2017-10-22 Thread Kirk Brooks via 4D_Tech
Hi Keith,
Huh - that sounds like the problem I'm having. Plus I was thinking the
added document ref would remain valid - like adding an object to a c-obj.
That's not the way it works I know now. Makes sense to get the elements and
just add those. That's more or less what I would up doing anyway.

Thanks for the insight.

On Sun, Oct 22, 2017 at 8:24 AM, Keith Culotta via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I think I recall a discussion a while back about SVG_Add_object not
> working well when the object being added was another svg document.
> Two svg docs can be "combined" using SVG_ELEMENTS_TO_ARRAYS, and
> SVG_Add_object for each reference in the doc being added.
> This technique doesn't produce a complete merge if doc2 has structures,
> like patterns, that the elements of doc2 depend on.
>
> --
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: SVG add object question

2017-10-22 Thread Keith Culotta via 4D_Tech
I think I recall a discussion a while back about SVG_Add_object not working 
well when the object being added was another svg document.
Two svg docs can be "combined" using SVG_ELEMENTS_TO_ARRAYS, and SVG_Add_object 
for each reference in the doc being added.
This technique doesn't produce a complete merge if doc2 has structures, like 
patterns, that the elements of doc2 depend on.

Keith - CDI

> On Oct 21, 2017, at 1:48 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I must be confused about how this works. I have some SVG files I want to
> use to create button icons. These are nice, simple, native SVG. I want to
> manipulate them using SVG. I can open a file and export it to a pic
> variable just fine. But I'm not able to put that object into a new svg.
> 
> For example:
> 
> $svgImg:=SVG_Open_file ($path+$aDocs{$n})
> 
> $svg:=SVG_Copy ($svgImg)
> $pic1:=SVG_Export_to_picture ($svg;0)
> SVG_CLEAR ($svg)
> 
> This works as expected.
> 
> $svg:=SVG_New
> $newObj:=SVG_Add_object ($svg;$svgImg)
> $pic2:=SVG_Export_to_picture ($svg;0)
> 
> 
> This doesn't work. $pic2 is blank even though $svg has received the new
> object. I can see that by looking at $svg in the viewer.
> 
> What am I missing here?
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> *The only thing necessary for the triumph of evil is for good men to do
> nothing.*
> 
> *- Edmund Burke*
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: SVG add object question

2017-10-22 Thread Peter Bozek via 4D_Tech
On Sat, Oct 21, 2017 at 8:48 PM, Kirk Brooks via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> For example:
>
> $svgImg:=SVG_Open_file ($path+$aDocs{$n})
>
> $svg:=SVG_Copy ($svgImg)
> $pic1:=SVG_Export_to_picture ($svg;0)
> SVG_CLEAR ($svg)
>
> This works as expected.
>
> $svg:=SVG_New
> $newObj:=SVG_Add_object ($svg;$svgImg)
> $pic2:=SVG_Export_to_picture ($svg;0)
>
>
> This doesn't work. $pic2 is blank even though $svg has received the new
> object. I can see that by looking at $svg in the viewer.
>
> What am I missing here?
>

Kirk, I do not have answer as I do not use SVG component to manipulate SVG,
I handle them with XML commands. Note that SVG objects are just XML trees
and can be manipulated with XML  commands. For example, you can use command
DOM EXPORT TO FILE
to export SVG as XML file and explore it in text or XML editor.

In your case, I would guess that $svg is not properly formed as SVG image.

--

Peter Bozek
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: SVG add object question

2017-10-22 Thread Kirk Brooks via 4D_Tech
Jim,
No, the file is an SVG document made up of XML. SVG_open_picture is what
you're thinking of.

On Sun, Oct 22, 2017 at 2:46 AM, Jim Dorrance via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> You are opening an image, not  xml. You should save the source xml also and
> edit it
>
> On Sat, Oct 21, 2017 at 8:48 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> > I must be confused about how this works. I have some SVG files I want to
> > use to create button icons. These are nice, simple, native SVG. I want to
> > manipulate them using SVG. I can open a file and export it to a pic
> > variable just fine. But I'm not able to put that object into a new svg.
>

-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: SVG add object question

2017-10-22 Thread Jim Dorrance via 4D_Tech
You are opening an image, not  xml. You should save the source xml also and
edit it

On Sat, Oct 21, 2017 at 8:48 PM, Kirk Brooks via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I must be confused about how this works. I have some SVG files I want to
> use to create button icons. These are nice, simple, native SVG. I want to
> manipulate them using SVG. I can open a file and export it to a pic
> variable just fine. But I'm not able to put that object into a new svg.
>
> For example:
>
> $svgImg:=SVG_Open_file ($path+$aDocs{$n})
>
> $svg:=SVG_Copy ($svgImg)
> $pic1:=SVG_Export_to_picture ($svg;0)
> SVG_CLEAR ($svg)
>
> This works as expected.
>
> $svg:=SVG_New
> $newObj:=SVG_Add_object ($svg;$svgImg)
> $pic2:=SVG_Export_to_picture ($svg;0)
>
>
> This doesn't work. $pic2 is blank even though $svg has received the new
> object. I can see that by looking at $svg in the viewer.
>
> What am I missing here?
>
> --
> Kirk Brooks
> San Francisco, CA
> ===
>
> *The only thing necessary for the triumph of evil is for good men to do
> nothing.*
>
> *- Edmund Burke*
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **




-- 
Jim Dorrance
jim.dorra...@gmail.com
4...@dorrance.eu
www.4d.dorrance.eu

PS: If you know of anyone that needs an experienced 4D programmer to add
energy and experience to their team, please let me know. I have
experience in many areas. Reasonable rates. Remote or Paris only.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

SVG add object question

2017-10-21 Thread Kirk Brooks via 4D_Tech
I must be confused about how this works. I have some SVG files I want to
use to create button icons. These are nice, simple, native SVG. I want to
manipulate them using SVG. I can open a file and export it to a pic
variable just fine. But I'm not able to put that object into a new svg.

For example:

$svgImg:=SVG_Open_file ($path+$aDocs{$n})

$svg:=SVG_Copy ($svgImg)
$pic1:=SVG_Export_to_picture ($svg;0)
SVG_CLEAR ($svg)

This works as expected.

$svg:=SVG_New
$newObj:=SVG_Add_object ($svg;$svgImg)
$pic2:=SVG_Export_to_picture ($svg;0)


This doesn't work. $pic2 is blank even though $svg has received the new
object. I can see that by looking at $svg in the viewer.

What am I missing here?

-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**