Hi,

For those that went to the world tour last year there was a php
example written by Angelo Caroprese.

Very easy to use, but I'm not certain if I'm allowed to post it here
though, so I'll check with him first.

Regards,

Wayne


Wayne Stewart
about.me/waynestewart




On 14 October 2016 at 08:14, Chip Scheide <4d_o...@pghrepository.org> wrote:
> THanks!
>
> I have one problem with this code
> SVG_SET_BRIGHTNESS
>
> This command does not seem to be part of the 4DSVG component (v13)
> anyone have a replacement command(s)
>
> THanks
>
> On Thu, 13 Oct 2016 14:02:13 -0700, Kirk Brooks wrote:
>> I'm going to seek to close this out by posting Miyako's method for
>> accomplishing my original question plus a trivial addition of my own. This
>> really demonstrates the power of SVG. My part is adding $2. You pass in a
>> picture and the method returns a 4 line version of the original for use as
>> a picture button. If you include $2 the picture is transformed into a
>> square of that size and then converted.
>>
>> You can just paste this into your db now - no plugin required, only the
>> 4D_SVG component.
>>
>>   //  Pic_make_4stateIcon
>>   // Written by: Miyako
>>   // ------------------
>>   // Method: Pic_make_4stateIcon (picture{;longint}) -> picture
>>   // $1 is a picture
>>   // $2 is the target size of the final icon -  will be square
>>   // $0 is a 4 state icon image made from that picture
>>   // Purpose: takes the picture in $1 and generates a new picture with
>>   // the original image and the 3 other icon states:
>>   //  1)normal / 2)clicked / 3)hover / 4)disabled
>>
>>
>> C_PICTURE($1;$0)
>> C_LONGINT($2;$width;$height)
>>
>> C_PICTURE($normal;$click;$hover;$disabled)
>> C_TEXT($svg;$g;$image)
>> C_REAL($x;$y)
>>
>>   // Original image
>> $normal:=$1
>>
>> If (Count parameters>1)
>>
>> PICTURE PROPERTIES($normal;$width;$height)
>> $x:=$2/$width
>> $y:=$2/$height
>> TRANSFORM PICTURE($normal;Scale;$x;$y)
>>
>> End if
>>
>> $svg:=SVG_New
>> $g:=SVG_New_group ($svg)
>> $image:=SVG_New_embedded_image ($g;$normal)
>>
>>   //Click: add more bright
>> SVG_SET_BRIGHTNESS ($g;1.2)
>> $click:=SVG_Export_to_picture ($svg)
>>
>>   //Hover: add more bright to previous image
>> SVG_SET_BRIGHTNESS ($g;1.35)
>> $hover:=SVG_Export_to_picture ($svg)
>>
>>   //Disabled: reduce brightness and set grayscale
>> SVG_SET_BRIGHTNESS ($g;0.7)
>> $disabled:=SVG_Export_to_picture ($svg)
>> TRANSFORM PICTURE($disabled;Fade to grey scale)
>>
>> SVG_CLEAR ($svg)
>>
>> $0:=$normal/$click/$hover/$disabled
>>
>> On Tue, Oct 11, 2016 at 6:29 PM, Kirk Brooks <lists.k...@gmail.com> wrote:
>>
>>> I have a cool set of PNG icons drawn at 512 x512 px. If I drop them onto a
>>> form they look great and resize perfectly. If I include one in a button (
>>> source = file; Images/png/cancel-button.png) they are inserted at full
>>> size which doesn't work very well.
>>>
>>> Is there a way I can cause the PNG to resize without either loading the
>>> image into a variable or manage it as a separate element on the form?
>>>
>>> Thanks
>>>
>>> --
>>> Kirk Brooks
>>> San Francisco, CA
>>> =======================
>>>
>>
>>
>>
>> --
>> Kirk Brooks
>> San Francisco, CA
>> =======================
>> **********************************************************************
>> 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
> **********************************************************************
**********************************************************************
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
**********************************************************************

Reply via email to