Page 1 of 1

Anyone have example code for creating banners from an image?

Posted: Thu Feb 16, 2017 5:33 pm
by keithglong
Hi All,

I am about to start working on some code to create image banners (i.e., rectangle image bars) from selected images. If anyone has done this before and perhaps has some sample code they would be willing to share, then that would be awesome. (Before rolling my own, I figured it might be a good thing to check.) Thanks; I really appreciate it.

Sincerely,

Keith "Boo" Long
Gulf Breeze, Florida

Re: Anyone have example code for creating banners from an im

Posted: Thu Feb 16, 2017 7:39 pm
by bn
Hi Keith,

good to see you.

What do you mean by banner. Do you mean a cropped image to the dimensions of the banner or what?

Kind regards
Bernd

Re: Anyone have example code for creating banners from an im

Posted: Fri Feb 17, 2017 12:14 am
by keithglong
Hi Bernd,

Good to see you! Yeppers; I am referring to a banner image cropped from a standard photo. (I wrote my previous post kind of quickly and should have clarified it better.)

In particular, I hope to generate banner images that can be used on responsive Web pages, something like the following:

https://www.electrictoolbox.com/example ... anner.html

You are the guru, so I welcome your feedback. And as always, thank you. :-)

Sincerely,

Keith "Boo" Long
Gulf Breeze, Florida

P.S. Kelly and I enjoyed meeting you at the Conference in Edinburgh last summer.

Re: Anyone have example code for creating banners from an im

Posted: Fri Feb 17, 2017 12:55 am
by bn
Hi Keith,

here is a little stack that shows how to use the crop command.

There is a transparent graphic that you drag over the top image and then click on button "cropImage" to crop the image, put it into the bottom image and restore the top image from a custom property of the card that contains the image. Change the graphic's size/proportions to what you want by resizing the graphic.

from the dictionary
Important: The crop command cannot be used on a referenced control|referenced image>. Doing so will cause an execution error.
If you have a referenced image you would have to use

Code: Select all

set the imageData of image "myImage" to the imageData of image "myImage"
this turns the referenced image into a local image that you can crop.

The stack is just bare bones but should get you started.

Kind regards
Bernd

Re: Anyone have example code for creating banners from an im

Posted: Sat Feb 18, 2017 5:13 pm
by keithglong
Thanks Bernd.