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



  // Original image

If (Count parameters>1)

PICTURE PROPERTIES($normal;$width;$height)
TRANSFORM PICTURE($normal;Scale;$x;$y)

End if

$g:=SVG_New_group ($svg)
$image:=SVG_New_embedded_image ($g;$normal)

  //Click: add more bright
$click:=SVG_Export_to_picture ($svg)

  //Hover: add more bright to previous image
$hover:=SVG_Export_to_picture ($svg)

  //Disabled: reduce brightness and set grayscale
$disabled:=SVG_Export_to_picture ($svg)
TRANSFORM PICTURE($disabled;Fade to grey scale)

SVG_CLEAR ($svg)


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

Reply via email to