Widget imageWidget_v110

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Widget imageWidget_v110

Geoff Canyon via use-livecode
### v1.0.0 Aug 25, 2018 ... first (nearly) complete version
### v1.1.0 Oct 17, 2018 ... first version on "Sample Stacks"

Widget ImageWidget will blow you away. Why?
Because it demonstrates the enormous possibilities that LiveCode
Builder already provides. I tried to do everything in pure LCB.
There is only script access where I was forced to do, because LCB
is not yet ready: Networking and adjusting the widget's size. So:

** ImageWidget is dedicated to the LC team, the makers of LCB. **

The widget transforms images of up to screen size in "real time".

You can load raw imagedata from your stack, load an image from a
local file or load an image or raw data (with saving) from an URL.
You can also overlay an (also shaped) text/caption.

The base position of the 9 handles are (use a monospaced font):

  ##############################
  # 1=TL ----- 2=TM ----- 3=TR #
  #  |                     |   #
  # 8=ML       0=MM       4=MR #
  #  |                     |   #
  # 7=BL ----- 6=BM ----- 5=BR #
  ##############################

[M=Midth, T=Top, L=Left, R=Right, B=Bottom]

Affine Transformations by click- and/or drag-actions:

[*] Near 0=MM but not 0=MM: Rotate,
[*] RightClick 0=MM: ResetImage,
[*] 0=MM: ResetShape (width 360),
[*] 2=TM: SkewX (= shearX),
[*] 4=MR: SkewY (= shearY),
[*] 6=BM: TrueHeight,
[*] 8=ML: TrueWidth,
[*] 1=TL,3=TR,5=BR,7=BL: TrueResize.

[True = preserves current shape.]

++ RightClick switches the action of handles (2=TM, 6=BM) and
(4=MR, 8=ML).
++ RightClick on handles (1=TL, 3=TR, 5=BR, 7=BL) inverts
temporarily the current "proportional" settings .

ImageWidget is a "fat" widget that works with LC 8 and LC 9
identically and also in all LC editions, from community up to
business. [Except that you need LC 9 when using
drawingSVGcompile for loading an SVG file to the image.]

The code has 3500 lines (incl. 800 lines for the dictionary),
there is a lot of math to do when getting the affine transforms:
the widget computes the current transform from the current
position of the handles. The source (lcb-file) is not included.

The widget is free for non-commercial use. For commercial use
please give a (small) fee to the LC developer help fund.

Download ImageWidget_v107 from "Sample Stacks" or
http://livecodeshare.runrev.com/stack/912

+++++++++
Someday, everything is gonna be diff'rent,
when I paint my masterpiece.  (Bob Dylan)


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Widget imageWidget_v110

Geoff Canyon via use-livecode
Herman,
Your contributions are amazing and always push the bounds of what can be done with livecode. I’ll download this when I get back to my computer.
Best,
Bill

William Prothero
http://ed.earthednet.org

> On Oct 17, 2018, at 8:59 AM, hh via use-livecode <[hidden email]> wrote:
>
> ### v1.0.0 Aug 25, 2018 ... first (nearly) complete version
> ### v1.1.0 Oct 17, 2018 ... first version on "Sample Stacks"
>
> Widget ImageWidget will blow you away. Why?
> Because it demonstrates the enormous possibilities that LiveCode
> Builder already provides. I tried to do everything in pure LCB.
> There is only script access where I was forced to do, because LCB
> is not yet ready: Networking and adjusting the widget's size. So:
>
> ** ImageWidget is dedicated to the LC team, the makers of LCB. **
>
> The widget transforms images of up to screen size in "real time".
>
> You can load raw imagedata from your stack, load an image from a
> local file or load an image or raw data (with saving) from an URL.
> You can also overlay an (also shaped) text/caption.
>
> The base position of the 9 handles are (use a monospaced font):
>
>  ##############################
>  # 1=TL ----- 2=TM ----- 3=TR #
>  #  |                     |   #
>  # 8=ML       0=MM       4=MR #
>  #  |                     |   #
>  # 7=BL ----- 6=BM ----- 5=BR #
>  ##############################
>
> [M=Midth, T=Top, L=Left, R=Right, B=Bottom]
>
> Affine Transformations by click- and/or drag-actions:
>
> [*] Near 0=MM but not 0=MM: Rotate,
> [*] RightClick 0=MM: ResetImage,
> [*] 0=MM: ResetShape (width 360),
> [*] 2=TM: SkewX (= shearX),
> [*] 4=MR: SkewY (= shearY),
> [*] 6=BM: TrueHeight,
> [*] 8=ML: TrueWidth,
> [*] 1=TL,3=TR,5=BR,7=BL: TrueResize.
>
> [True = preserves current shape.]
>
> ++ RightClick switches the action of handles (2=TM, 6=BM) and
> (4=MR, 8=ML).
> ++ RightClick on handles (1=TL, 3=TR, 5=BR, 7=BL) inverts
> temporarily the current "proportional" settings .
>
> ImageWidget is a "fat" widget that works with LC 8 and LC 9
> identically and also in all LC editions, from community up to
> business. [Except that you need LC 9 when using
> drawingSVGcompile for loading an SVG file to the image.]
>
> The code has 3500 lines (incl. 800 lines for the dictionary),
> there is a lot of math to do when getting the affine transforms:
> the widget computes the current transform from the current
> position of the handles. The source (lcb-file) is not included.
>
> The widget is free for non-commercial use. For commercial use
> please give a (small) fee to the LC developer help fund.
>
> Download ImageWidget_v107 from "Sample Stacks" or
> http://livecodeshare.runrev.com/stack/912
>
> +++++++++
> Someday, everything is gonna be diff'rent,
> when I paint my masterpiece.  (Bob Dylan)
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Widget imageWidget_v110

Geoff Canyon via use-livecode
In reply to this post by Geoff Canyon via use-livecode
Hey HH!

1) This is amazingly fast!
2) Where do I put the money for the help fund?
3) How does LCB compare to JS speed wise?
4) Thanks so much for all your contributions!!!

Cheers!

Malte!

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Widget imageWidget_v110

Geoff Canyon via use-livecode
In reply to this post by Geoff Canyon via use-livecode
> Malte P. wrote:
> Hey HH!

Hey Malte!

> 1) This is amazingly fast!

The judgement of the master of animations ...

The speed too blew me away the first time it worked.
Everything is done by computing and applying an
affine transform for the canvas.

> 2) Where do I put the money for the help fund?

You are **the first** who asks. It is not yet started.
Who is ready to manage that fund? (Lagi?)

> 3) How does LCB compare to JS speed wise?

It is at about the same speed compared to JS transforms,
also compared to CSS3 transforms.
But JS gives the option to access the pixels of an image
very fast by its canvas methods, LCB is slow with that.
So perspective transformations need JS (via a browser
widget).

> 4) Thanks so much for all your contributions!!!

Thanks forwarded to the LC team for creating LCB.
It allows much more things than I expected. WOW.

Now the imagewidget is kind of a (still uncomplete)
"kitchen sink" of LCB methods.

If it were possible to have *direct access* to JS in
LCB (not via a broser widget) and if also base64coding
were available then we could have kind of an image
processing app in a widget!!
All I would need is such an access to mBrowser: all
but the native display, so that HTML5 is working.
(I tried to manipulate the browser widget but had
problems with the native display.)

> Cheers!
Ciao.

> Malte!

Hermann

p.s. What is the factorial of Malte?


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Widget imageWidget_v110

Geoff Canyon via use-livecode
Looks like work was started for adding encoding functions to LCB:
https://github.com/livecode/livecode/blob/develop/libscript/src/encoding.lcb
https://github.com/livecode/livecode/blob/develop/libscript/src/module-encoding.cpp

Looking at the C source, looks like error reporting is needed along with binary encode moving to foundation and encode/decode without specifying the type. The non-statement syntax definitions also need to be updated (I think, not sure where that would be documented though). Can’t use the functions directly right now since they are not exported (missing MC_DLLEXPORT where defined).

Thanks,
Brian
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Widget imageWidget_v110

Geoff Canyon via use-livecode
In reply to this post by Geoff Canyon via use-livecode
Thanks for looking at that, Brian.

Your help could make encoding spring to life in LCB.

See also bug #20521 and
http://lists.runrev.com/pipermail/use-livecode/2017-November/243064.html

Hermann

> Brian M. wrote:
> Looks like work was started for adding encoding functions to LCB:
> https://github.com/livecode/livecode/blob/develop/libscript/src/encoding.lcb
> https://github.com/livecode/livecode/blob/develop/libscript/src/module-encoding.cpp
> Looking at the C source, looks like error reporting is needed along
> with binary encode moving to foundation and encode/decode without
> specifying the type. The non-statement syntax definitions also need
> to be updated (I think, not sure where that would be documented though).
> Can’t use the functions directly right now since they are not exported
> (missing MC_DLLEXPORT where defined).
> Thanks, Brian

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Widget imageWidget_v110

Geoff Canyon via use-livecode
In reply to this post by Geoff Canyon via use-livecode
Hi I'm Honoured Herman, and I was going to donate my self even though I
have as yet no need for the Widget - but I have donated many times before
when I think someone has done something that has to be acknowledged in some
way.

To be honest I was thinking of getting a gofundme type of theme and use
that - so we don't give x percent to gofundme. - and the hoops you have to
go through to assign money.

I Also think we shouldn't just make it a developers fund (please agree or
disagree) but make it a fund where we can have a survey of what we think LC
should work on and fund it to get it working - and hold their feet to the
fire - I'm still waiting for the SQLITE library .... May 2016 - "We will
deliver the project within a three month window on successful completion of
the campaign."), e..g.Bluetooth, more examples of the FFI.

I'm hoping from what I surmise that LC for Filemaker looks like it is
bringing in the money for programmer expansion so anything useful to us is
useful to the FM group and maybe this might not bee needed soon - but again
we don't have to be dogmatic about this.

If we can get a coiterie of 100+ people together who could just send $5 a
month and increase that to $10 if we have an urgent need (whether a
programming need or even a "Programming Colleague in Distress" we could
come  to an agreement as to how to use the funds.

THis could maybe after 6 months have enough to crowd fund Herman's wish

"If it were possible to have *direct access* to JS in
LCB (not via a broser widget) and if also base64coding
were available then we could have kind of an image
processing app in a widget!!
All I would need is such an access to mBrowser: all
but the native display, so that HTML5 is working.
(I tried to manipulate the browser widget but had
problems with the native display.)"

I think we need to open a paypal account to keep the money in and give
access to more than one person - can you get joint ones? -  - you never
know we still have buses on our roads!

If we go the "programmer Aid" route we could use
https://www.paypal.com/uk/webapps/mpp/not-for-profit.

Or we could do both?

WDYT is this too much pie in the sky or shall we just do the Programmer
fund? I for one think money just sitting there doing nothing waiting for a
rainy day isn't doing anyone any good.
I could setup a webpage with the "manifesto" on it and we can tweak until
we agree - It may be that Herman's simple idea is best but I'm just putting
this out there.

Kindest Regards Lagi

p.s.

On high  note - I have noticed a few of posts on the forum/uselist  from
Sean (Pi) Cole   who we helped with the gofundme initiative and that makes
me feel very happy. It would be nice if we can get any feedback as to the
status of Sean's project and did he manage to salvage something - over to
you Sean.

On Sat, 20 Oct 2018 at 15:03, hh via use-livecode <
[hidden email]> wrote:

> > Malte P. wrote:
> > Hey HH!
>
> Hey Malte!
>
> > 1) This is amazingly fast!
>
> The judgement of the master of animations ...
>
> The speed too blew me away the first time it worked.
> Everything is done by computing and applying an
> affine transform for the canvas.
>
> > 2) Where do I put the money for the help fund?
>
> You are **the first** who asks. It is not yet started.
> Who is ready to manage that fund? (Lagi?)
>
> > 3) How does LCB compare to JS speed wise?
>
> It is at about the same speed compared to JS transforms,
> also compared to CSS3 transforms.
> But JS gives the option to access the pixels of an image
> very fast by its canvas methods, LCB is slow with that.
> So perspective transformations need JS (via a browser
> widget).
>
> > 4) Thanks so much for all your contributions!!!
>
> Thanks forwarded to the LC team for creating LCB.
> It allows much more things than I expected. WOW.
>
> Now the imagewidget is kind of a (still uncomplete)
> "kitchen sink" of LCB methods.
>
> If it were possible to have *direct access* to JS in
> LCB (not via a broser widget) and if also base64coding
> were available then we could have kind of an image
> processing app in a widget!!
> All I would need is such an access to mBrowser: all
> but the native display, so that HTML5 is working.
> (I tried to manipulate the browser widget but had
> problems with the native display.)
>
> > Cheers!
> Ciao.
>
> > Malte!
>
> Hermann
>
> p.s. What is the factorial of Malte?
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode