Re: LC-Magick Collection

2017-01-31 Thread hh via use-livecode
Tracing all opaque parts of a picture with transparency, not only the
outline, is one of the tools that BerndN uses in button "TracedAntialias"
for the bilinear distortion, the tracing method used is "radial sweep".

We should ask him to make an own 'little stack' for "Antialiased Tracing"
where he describes his technique in some detail.

There are already really marvellous imaging tools written in LiveCode
available. And certainly I don't know all.
Perhaps we should start to collect them at one place, ask the authors
of these jewels to contribute.

My idea for this LC-magick collection here was to add only such techniques
that were not, or not this fast, available until now in LiveCode and that
are somehow connected to imageMagick. But that's only an idea.

As my last contribution for a while will follow this month
"DeLinear Perspective Distortion"
a tool that may help to "UnPerspective/ UnRotate/ UnSkew". Especially
people using OCR sometimes need that.

Hopefully others come in to enlarge this collection or build a new one.
Just open your treasure chests.

Hermann

> Roger E. wrote:
> I think your stack that traces the outlines of a multicolor PNG into polygon 
> shapes would be a fabulous addition to this image tool collection. ~Roger
> > hh wrote:
> > Added today #6: Bilinear Perspective Image Distortion 
> > Distortion part by 'hh', Antialiasing part by 'BNig'. 
> >
> > LC-Magick #1 - Blur and Pixelate (Scott R.) 
> > http://tactilemedia.com/blog/2016/03/26/update-blur-effect-
> > plus-pixelize-bonus/ 
> > LC-Magick #2 - Pointillize (Hermann H.) 
> > http://forums.livecode.com/viewtopic.php?p=141051#p141051
> > LC-Magick #3 - Image Multiplexing (Hermann H.) 
> > http://forums.livecode.com/viewtopic.php?p=141272#p141272
> > LC-Magick #4 - Linear Perspective Image Distortion (Hermann H.) 
> > http://forums.livecode.com/viewtopic.php?p=148647#p148647
> > LC-Magick #5 - Circular (Polar) Image Distortion (Hermann H. and Bernd N.) 
> > http://forums.livecode.com/viewtopic.php?p=14#p14
> > LC-Magick #6 - Bilinear Perspective Image Distortion (Hermann H. and Bernd 
> > N.) 
> > http://forums.livecode.com/viewtopic.php?p=150757#p150757
> >
> > Most of it is based on ideas presented in imageMagick's documentation 
> > http://www.imagemagick.org/Usage/

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Yertle the Turtle

2017-01-31 Thread hh via use-livecode
> Richmond wrote:
> The problem is that (as far as I am aware) LiveCode cannot
> move objects for fractions of pixels.

Even if it could, this would be not enough, because sqrt(2)
is an irrational number ;-)

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Yertle the Turtle

2017-01-31 Thread hh via use-livecode
> Colin H. wrote:
> I’m sure any system would not attempt to parse an infinite number of decimal
> places. The turtle would probably be placed at 1.41421356237 pixels. If you
> want to try more accurately than that, here’s the first million decimal 
> places: 
> https://apod.nasa.gov/htmltest/gifcity/sqrt2.1mil

To make the confusion complete (or remove it):
If the turtle of Pythagoras, sitting at (0,0) had to move sqrt(2) units, it
would do that nevertheless *exactly*, crawling for example from (0,0) to (1,1).
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Size of Image in RAM

2017-02-07 Thread hh via use-livecode
Scott is right:
JPEG has exactly one _color_ mode: 16M = 2^24 (seen apart of 256 gray-color 
mode).

What you interpret as "8bit-color-mode" relates to the _compression_ mode which
also explains the relation filesize vs (uncompressed) size in memory.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Mobile library for barcodes?

2017-01-31 Thread hh via use-livecode
> Devin A. wrote:
> I am actually interested in *bar code* reading rather than QR codes.

https://github.com/trozware/rev_stacks/  ?


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


LC-Magick Collection

2017-01-31 Thread hh via use-livecode
Added today #6: Bilinear Perspective Image Distortion
Distortion part by 'hh', Antialiasing part by 'BNig'.

LC-Magick #1 - Blur and Pixelate (Scott R.)
http://tactilemedia.com/blog/2016/03/26/update-blur-effect-plus-pixelize-bonus/
LC-Magick #2 - Pointillize (Hermann H.)
http://forums.livecode.com/viewtopic.php?p=141051#p141051
LC-Magick #3 - Image Multiplexing (Hermann H.)
http://forums.livecode.com/viewtopic.php?p=141272#p141272
LC-Magick #4 - Linear Perspective Image Distortion (Hermann H.)
http://forums.livecode.com/viewtopic.php?p=148647#p148647
LC-Magick #5 - Circular (Polar) Image Distortion (Hermann H. and Bernd N.)
http://forums.livecode.com/viewtopic.php?p=14#p14
LC-Magick #6 - Bilinear Perspective Image Distortion (Hermann H. and Bernd N.)
http://forums.livecode.com/viewtopic.php?p=150757#p150757

Most of it is based on ideas presented in imageMagick's documentation
http://www.imagemagick.org/Usage/

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: HTML5 and different editions

2017-01-22 Thread hh via use-livecode
Keith M. wrote:
> HTML5 production is part of the LiveCode Community edition, which is 
> fantastic. It's in the Business edition too, of course. The Indy 
> edition, however, doesn't allow HTML5 production at all.


In which version do you see this?
I made close to all of my > 50 examples (hh.on-rev.com/html5/) with Indy.
(There are only two versions, 8.0.2 and 9.0.0 there from loading speed reasons.)
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: HTML5 and different editions

2017-01-22 Thread hh via use-livecode
I don't understand.
Keith writes about the ability to make standalones, not about the license.
I thought *every* edition of LiveCode can create HTML5 standalones?
(I can't test because I have a HTML5 license).
If not, that is possibly because Indy can set passwords to all standalones,
what has to be separately licensed for HTML5.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Script editor chops "end handler" to "nd handler"

2017-01-27 Thread hh via use-livecode
I cannot confirm this, it's even more:
"en" is chopped.

[Also, sometimes: When hitting immediately after that the backspace key a zero 
appears.]

This is only with code that is not "beautified" (all lines begin at left). I 
tried my own, not your demo.

[I had also _sometimes_ similar chopping when I opened in LC 8/9 a 6.7.11 
script, *without* any edit.]

MacOS 10.12.3 - LC 8.1.3rc1 AND LC 9.0.0dp4


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Browser Widget/HTML5/LC Integration

2017-01-28 Thread hh via use-livecode
BR wrote:
"Even my attempts with AnimationEngine which is, I believe as good as it's
going to ever get with LC's engine, have a clunky, jerky feel."

I tried to generate such "bad" graphics in LC without any success. So:
Could we see (at least one of) such attempts? Don't forget the source code.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Browser Widget/HTML5/LC Integration

2017-01-28 Thread hh via use-livecode
> BR wrote:
> Sure.. try this:
> go stack url "http://wiki.hindu.org/uploads/SivasHawaiiRevels_v001.livecode;
> it's so "bad" as it is "just below par" enough to cause others to blink at it.

It's not the LC graphics it's the "jagged" and "uncomplete" scripting.
LC can do much more.

Some basic examples related to the starting animation:
= You use "wait " for animations (!!!) and moreover
  +++ with  far below the refreshrate of the app. 
  +++ with  independent of the device.
= You animate along a random (jagged) line of points ignoring the
  existence of smooth curves.
= You use an image that doesn't even have an antialiased border.

So
> BR wrote:
> ... one html5 man who work in Angular and soon React.
You need help to use huge non-free JS frameworks?

Compare that in *real* costs to LiveCode. LiveCode is not a presentation app
(like PowerPoint or its daughter Keynote or some Adobe products).
It's not an image processing app (like Photoshop or Gimp or GraphicConverter).
It's not a vector graphics app (like Inkscape or some Adobe products).
And it's not a "robust" WebApp framework (robust against package-coded HTML5)*.
But you can have special parts of that built on LiveCode:
Simply buy extensions for your specialised uses, hire freelancers.

(To avoid any misunderstanding, I'm not a freelancer but I know some. Probably
I don't know as many as you know).

_
* Also, some of LC's HTML5 deployment modules could do a lot of that.
It needs supporters by buying HTML5-licenses, do you have one?


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Reveal in Find on Windows

2017-02-23 Thread hh via use-livecode
@Roger
I adjusted (uncompletely) the name to the OP's handler name.

Yes, you are right, the handler only opens the enclosing folder
(or any path item of such a folder path).

The purpose of my post was to second the "launch document" solution
for folders and moreover to add the linux variant for the ubuntu-
and debian-flavours (most Raspis run also linux).

I saw the "launch document" method for folders first, as a real
beginner, in an old post of Klaus in the forum.

For revealing/selecting the file one needs, as was partially
explicitly pointed out in other posts before (thanks for that),
specific tools for each platform. Some time ago I tried several hours
to find general variants but I gave up eventually because it is
moreover, within the platform, specific for OS-releases/OS-flavours.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Goofy Drawing question

2017-02-25 Thread hh via use-livecode
Assuming you wish to draw, not to paint:

local gg="goofy", fc="255,0,0", ls=3

on mouseUp
  lock screen
  if there is no grc gg then create grc gg
  set style of grc gg to "polygon" -- or "line"
  set points of grc gg to (250,250),(375, 375)
  set lineSize of grc gg to ls
  set forecolor of grc gg to fc
  unlock screen
end mouseUp

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Posting delay

2017-02-25 Thread hh via use-livecode
I have currently a "posting delay" (time between sending the mail
and the becoming visible in the list) of 40 up to 60 minutes.
Is this the consequence of a changed incoming spam filter?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Reveal in Find on Windows

2017-02-23 Thread hh via use-livecode
The following works here on Mac/Win/Linux with LC 6/7/8/9.

All my newer stacks have a menu (small square at top left)
to do that for each path item of the current stack path.

##  Opens the folder that contains the file pFolderFile
command openWorkingFolder pFolderFile
   set itemdel to "/"
   put item 1 to -2 of pFolderFile into t
   set itemdel to ","
   if the platform is "linux" then
  try
 launch document t
 get shell("xdg-open " & quote)
  end try
   else launch document t
end openWorkingFolderInFinder   


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Reveal in Find on Windows

2017-02-23 Thread hh via use-livecode
> Richard G. wrote:
> There are three major desktop OSes. :)

Yes. And I'm _the only one_ in this thread who posted a handler
that serves all these three ...

http://lists.runrev.com/pipermail/use-livecode/2017-February/234858.html

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows and OSX 64-bit builds?

2017-02-10 Thread hh via use-livecode
Please post this "Split it!"- answer, as it is, in LC's blog.
This is good even for real beginners.

Large files or large data shouldn't be a reason for _incomplete_ 64Bit
implementations that would make once again LC Script slower.

> Mark Waddingham wrote:
> >
> > Tom Glod wrote:
> > I will... if u wanna replicate...put an image on a stack..make it
> > 32k x 32k
> > . and try and do a export snapshot of the image,  LC goes POOF... 
> > Trevor
> > said tha last version of 8 (8.13)  had some memory issues solves, so i 
> > will try to test is there too.
> 
> Currently, the engine implements 'export snapshot' by allocating a 
> raster (32-bits per pixel) of the size of the snapshot you are making, 
> rendering into it and then compressing it.
> 
> So really the maximum size you could hope to snapshot is 16k x* 16k 
> pixels as that requires 2Gb - the engine in general uses signed integer 
> indicies, so the maximum memory buffer it can manipulate is 2Gb bytes. A 
> 32-bit process would probably struggle to do that (due to only having 
> around 2-3Gb of user address space to use) - as there is overhead in 
> rasterization and then compression; but a 64-bit process should be fine.
> 
> There is a bug here as (at least in this specific case) the engine 
> should fail gracefully (as we know there is a hard limit in the size of 
> an image the engine can process).
> 
> As you correctly point out 32k x 32k comes in at 1Gb pixels - which at 
> 24-bit RGB comes out at 4Gb of data. No 'normal' 32-bit application 
> which isn't explicitly designed for manipulating huge images will be 
> able to deal with something that size. I would expect applications such 
> as Photoshop to be able to deal with them though since I believe their 
> native raw storage format for images pages from disk as required (so you 
> never have the 'whole thing' in memory at once - just the bit you are 
> looking at / editing).
> 
> One important thing to remember is that the amount of memory required to 
> take a snapshot is (SOMECONSTANT * 4 * the number of pixels) in the rect 
> of the snapshot (I've not checked but I would estimate 0 < SOMECONSTANT 
> < 2) which means that you can get LiveCode to generate very large 
> images, but you have to break the problem down by splitting up the 
> snapshot into bands and probably use an external (command-line) tool to 
> compress the image into your format of choice (how big an image such a 
> tool can process, again, will be dependent on whether it needs to load 
> the entire image into memory to compress it or not).
> 
> Rough idea:
> 
>  repeat with i = 0 to pHeight / kBandSize
> import snapshot from rect (0, pWidth, i * kBandSize, kBandSize)
> write the imageData of the last image to file tOutputFile
> delete the last image
>  end repeat
> 
> After this you will have a very large file with the raw xRGB data in it, 
> so you need to find a tool which can take raw 32-bit xRGB data (with 
> specified order of the RGB), the width and height and process it into 
> jpg or png or whatever format you require (I'm hoping others who know 
> more about such things might be able to chime in here - ImageMagick has 
> an arsenal of command-line tools, for example).
> 
> Warmest Regards,
> 
> Mark.
> 
> P.S. There is a hard limit of co-ordinate magnitude in LC and thus the 
> size of any object - 32767 pixels on any side of anything.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows and OSX 64-bit builds?

2017-02-11 Thread hh via use-livecode
This is a well known visual phenomena:
When I'm tired I also switch sometimes 'in between reading'
the temporarily memorized decimal point from the beginning to
the end of a three-digit-block (did it recently in the forum).

It mostly works for me (if not 'computing') to force myself
to obey the rule, for the decimal prefixes, starting from Byte:

Kilobytes = 10^3  Bytes => cut most right three
MegaBytes = 10^6  Bytes => cut most right 6 (another three)  
GigaBytes = 10^9  Bytes => cut most right 9 (another three)
TeraBytes = 10^12 Bytes => cut most right 12 (another three)

As Phil hints, to use number words may be misleading here because
'billion' has different meanings in Europe (1 billion = 10^12) and
in the USA (1 billion = 10^9).

>> Bob S. wrote:
>> Isn't it kBytes not bits? So 32,000 * 32000 Bytes (a pixel takes up
>> one Byte in 8 bit color) which comes to 1,024,000,000 BYTES. That's
>> 1.024 terabytes, unless my faculties have wholly abandoned me.
>> Of course, a black and white image is 1,024,000 BYTES, or 1.023 GIGS,
>> but are we talking about black and white images?
>
> Phil D. wrote:
> Your labels are one order of magnitude off the actual values, Bob. Say 
> it with me: 1,024,000,000 BYTES is "one billion bytes" (and change, 
> depending on whose standard you use). Of course one billion bytes is a 
> gigabyte.
> Same with the labeling of 1,024,000 BYTES = 1000kb = a megabyte, not a gig.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows and OSX 64-bit builds?

2017-02-13 Thread hh via use-livecode
> Bob S. wrote:
> I failed 6th grade math and then went on to ace algebra and geometry.
> Everyone can thank their lucky stars I didn't go in for Rocket Science! 

Documented in a letter:
"... Do not worry about your difficulties in Mathematics. I can assure
you mine are still greater.
Best regards Professor Albert Einstein."

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Formatting scripts in a field

2017-02-15 Thread hh via use-livecode
Some time ago there was a thread about formatting 'directly' the text of a
field or the selection of a field, without using manually the script editor:
http://runtime-revolution.278305.n4.nabble.com/Script-Indenting-tp4699437.html

I couldn't find a follow-up, so just in case this is not (publicly) solved,
here one way to do that.

Formatting/Beautifying means colorisation AND indentation.

So the following stack is complementary to the well known helper stacks of
Max V. and Paul H.
If you are interested you may try stack #91 in the Raspi collection:
http://forums.livecode.com/viewtopic.php?p=151405#p151405
The main script has 65 lines and simply prepares calls to handlers of LC's
script editor. Works (tested, slow only with LC 7) on Mac/Win/Linux/Raspi using 
latest of LC 6/7/8/9 (Raspi 6.5.1 and 7.0.4).
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Dragging widgets

2017-02-27 Thread hh via use-livecode
This is not a bug because a widget is not an ordinary control:
Nearly all user interaction has to be allowed and scripted.
I implemented a kind of "grab" in some of my LC8-widget examples.

You can for example also Not focus on a widget from LC Script (that's
why the browser widget is 'robust' against commands like "click"). 

To the current handling of elementary mouse messages by widgets/LCB
see for example here, in the LC Builder forum

http://forums.livecode.com/viewtopic.php?f=93=24369=mousedown

I don't know what's updated since then because the widget format changed
again with LC 9, so I wait first for a stable release before going on.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Image Manipulation by javascript/HTML5 using a widget

2017-02-28 Thread hh via use-livecode
Roger E. wrote:
>  Sounds very cool!  Where is the download link?

Use "Sample Stacks" in the LC toolbar (Sort descending by date) or
(slower) http://livecodeshare.runrev.com/ (at top if sorted by 'Newest')

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Image Manipulation by javascript/HTML5 using a widget

2017-02-28 Thread hh via use-livecode
Hi all.

There is a new sample stack by Jonathan Lynch called
"Browser Widget Image Manipulator".
This name could lead to underestimate a bit this stack. That's why
I would like to point to it.

This is a real clever solution, short and practicable. It uses the
image manipulation possibilities of javascript/HTML5 via the browser
widget. And it is, in LC 8, for shearing (and rotating) also faster
than my 'direct' imagedata solutions for shear and rotate in LC 6.

It could also be called

Image Manipulation by javascript/HTML5 using a widget

directly from LC, within the stack, nothing extern, no shell scripts.
It shows a direction of how to access some of the big image and graphics
libraries of js/HTML5.

Thanks for that great example Jonathan.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Nabble fools one of us

2017-01-13 Thread hh via use-livecode
Just in case somebody of us is wondering why he/she suddenly authored *all*
posts of this list since Jan 8 here:

http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

I can't see the logic which author is elected as the "one-for-all", but it's
certainly without asking that person and without looking if the person is
using Nabble.

For a while it was Bob S., currently it's Tiemo.
Perhaps the last poster to the list modulo some time shift?
Or is it a platform specific "malfunction"?

May be it is not Nabble but a changed "delivering" procedure?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC-Magick Collection

2017-01-10 Thread hh via use-livecode
Update to LC-Magick #5: Circular (Polar) Image Distortion
http://forums.livecode.com/viewtopic.php?p=14#p14

Bernd solved the antialiasing-border-problem with a brilliant technique
(using a fillGradient). Needs some more time but it's worth. Thanks BerndN!

> Added today #5: Circular (Polar) Image Distortion.
> 
> The distortion output is, not only in LC, somehow "jagged" at the border. I 
> tried
> to "soften" border using graphic effects. Bernd (bn) already showed me a 
> nearly
> perfect method for #4 (will be updated soon), sadly this can't handle 
> transparency.
> To everybody who's interested in image distortion methods:
> Is there a general improvement for my method/settings in #5 (see the script 
> of btn
> "Effects")?
> 
> > *** LC-Magick Collection ***
> > 
> > LC-Magick #1 - Blur and Pixelate (Scott R.)
> > http://tactilemedia.com/blog/2016/03/26/update-blur-effect-plus-pixelize-bonus/
> > 
> > LC-Magick #2 - Pointillize and Hatching
> > http://forums.livecode.com/viewtopic.php?p=141051#p141051
> > 
> > LC-Magick #3 - Image Multiplexing
> > http://forums.livecode.com/viewtopic.php?p=141272#p141272
> > 
> > LC-Magick #4 - Perspective Image Distortion
> > http://forums.livecode.com/viewtopic.php?p=148647#p148647
> > 
> > LC-Magick #5 - Circular (Polar) Image Distortion
> > http://forums.livecode.com/viewtopic.php?p=14#p14 <-- corrected 
> > from last
> > 
> > Most of it based on ideas presented on imageMagick's documentation
> > http://www.imagemagick.org/Usage/


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Setting the Cursor to an image

2017-01-12 Thread hh via use-livecode
> William P. wrote:
> I use:
> on mouseUp
> set the cursor to # —the ID of the image
> lock cursor
> end mouseUp 

You could try to _first_ lock the cursor then set it.
(This works for here).
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

LC-Magick Collection

2017-01-08 Thread hh via use-livecode
Added today #5: Circular (Polar) Image Distortion.

The distortion output is, not only in LC, somehow "jagged" at the border. I 
tried
to "soften" border using graphic effects. Bernd (bn) already showed me a nearly
perfect method for #4 (will be updated soon), sadly this can't handle 
transparency.
To everybody who's interested in image distortion methods:
Is there a general improvement for my method/settings in #5 (see the script of 
btn
"Effects")?

> *** LC-Magick Collection ***
> 
> LC-Magick #1 - Blur and Pixelate (Scott R.)
> http://tactilemedia.com/blog/2016/03/26/update-blur-effect-plus-pixelize-bonus/
> 
> LC-Magick #2 - Pointillize and Hatching
> http://forums.livecode.com/viewtopic.php?p=141051#p141051
> 
> LC-Magick #3 - Image Multiplexing
> http://forums.livecode.com/viewtopic.php?p=141272#p141272
> 
> LC-Magick #4 - Perspective Image Distortion
> http://forums.livecode.com/viewtopic.php?p=148647#p148647
> 
> LC-Magick #5 - Circular (Polar) Image Distortion
> http://forums.livecode.com/viewtopic.php?p=148647#p148647
> 
> Most of it based on ideas presented on imageMagick's documentation
> http://www.imagemagick.org/Usage/

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Suggestions regarding a webgl problem

2017-03-21 Thread hh via use-livecode
Did you already try https://browserleaks.com/webgl ?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Colour Manipulation

2017-03-26 Thread hh via use-livecode
Now this is also available, very fast, with the same speed, for LC 6/7/8/9
on Mac using Canvas2d in a revBrowser instance (on Win revBrowser doesn't 
support Canvas2d) in LC-ImageToolBox-67: Basics.

Get it via "Sample Stacks" of the LC-Toolbar or from
http://livecodeshare.runrev.com/stack/827/LCImageToolBox67%3A-Basics-v102

Somehow I missed the possibility of LC 6/7's revBrowser to use Canvas2D on
Mac until now, the gain in speed compared to 'ordinary' LCScript is terrific.
Just try in LC 7!

It was Jonathan's transform-demo for the browser widget that opened my eyes.
Thanks again for that example, Jonathan.

There's still a fast working solution for linux missing and for Raspi (which
sadly inherits the linux bugs with web browssing). Within the next weeks I
will publish LC-ImageToolBox-JIT for that (uses luaJIT), I have it already
running.

> hh wrote:
> Today I implemented this as part of LC-ImageToolBox-89: Basics.
> Get it _from LC 8/9_ via "Sample Stacks" of the LC-Toolbar or from
> 
> http://livecodeshare.runrev.com/stack/826/LC-ImageToolBox89%3A-Basics-v102
> 
> Uses Canvas2D (no webGL because of issues with some graphic cards)
> in a hidden browser widget. Your method gives nice Effects and works
> with a decent graphic card pretty fast. Needs here with LC 8/9 on a
> Mac mini 2.5 GHz/IntelHD4000 for a 1920x1080 image < 500 millisecs.
> 
>> Peter R. wrote:
>> I've got an app that allows the user to display an image using a
>> variable number of colours (2-24 colours).  In addition, the user
>> can specify upper and lower thresholds so that all pixels below a
>> specified value are displayed using a colour such as black and all
>> pixels with values above a specified value are displayed using a
>> colour such as red. 
>> Pixels with values between the thresholds are displayed using the
>> specified colour range of 2-24 colours. The images can consist of
>> up to 8-10 million pixels, they are rectangular and can be in a
>> landscape or portrait orientation.
>> 
>> Whilst I have this working the code that manages the changing of
>> the number and use of colours in an image is rather slow. This is
>> despite me using the "repeat for each" loop structure and lock the
>> screen wherever possible to get the maximum speed!
>> 
>> Does anyone have any clever algorithms, code, add-ons, etc that can
>> do this kind of thing in a flash?!


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Transparent Images in LC

2017-03-30 Thread hh via use-livecode
Yes, I also have seen this sometimes when special kinds of alphachannel
(flattened/premultiplied/postmultiplied) were used in the PNG to import.

Nevertheless the following 'standard' import script works for me nearly
always in LC 6/7/8/9:

on mouseUp
  set the paintcompression to RLE
  if there is no img "import" then create img "import"
  -- handles alphachannel clever, even creates sometimes its own:
  set the resizequality of img "import" to "best" 
  put "Select a file to import" into prmpt
  answer file prmpt titled prmpt -- avoid mac 10.12 bug
  if it is empty then exit mouseUp
  put URL("binfile:" & it) into img "import"
  -- don't "hide" my click region with transpareny:
  set topleft of img "import" to the bottomleft of me
end mouseUp

> Paul D. wrote:
> I was trying to import (as a control) a transparent PNG (i.e. the
> "white" parts allow whatever is underneath to show through) and instead
> of transparancy, I get the slashed background lines transparent PNG are
> often displayed with. Thinking it might be the PNG itself, I have our
> graphics person create a PNG that was transparent and shows up as
> transparent in other app, it still was not importing with the
> transparent parts transparent in LC.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Line numbers for soft-wrapped styled text?

2017-03-29 Thread hh via use-livecode
> Jim L. wrote:
> Just set the liststyle of the field that contains your editable text to
> ‘decimal’. Then the lines will be automatically numbered and outdented.
> Yet conveniently, the ’text’ and the ‘styledtext’ runs will not ‘contain'
> the numbering since it is a styling.

Now I finally understood your brilliant solution. Thank you very much for that!
It beats in speed all other solutions until now.

In sum I learned very important things in this thread:
Using a styledText array (by Alex Tweedly).
Using liststyles for _any_ field (by Jim Lambert).
You could now think about making a "Sample stack" for that (livecodeshare).

One thing to remark:
One has to adjust the "indention/oudention" by using the left margin and the
first indent. One can even make this width-adaptive to the num of lines and
adjust it in a way to make the numbering looking 'right aligned':

## LineNumbering technique by Jim Lambert
## (applied below by for adaptive and right-aligned indention by -hh).
## You need a field "TEXT" of styled Text and a checkButton "ShowNumbers".

## -- btn "showNumbers
on mouseUp
  if the hilite of me then showNumbers
  else hideNumbers
end mouseUp

## -- fld "TEXT
on textchanged
  if the hilite of btn "showNumbers" then showNumbers
  else hideNumbers
end textchanged

on scrollbardrag
  if the hilite of btn "showNumbers" then showNumbers
  else hideNumbers
end scrollbardrag

## card script
local rg="TEXT"

on hideNumbers
  lock screen; lock messages
  set the liststyle of line 1 to -1 of fld rg to empty
  set the firstindent of line 1 to -1 of fld rg to 0
  set the margins of fld rg to 8
  if there is a grc rg then hide grc rg
  unlock screen; unlock messages
end hideNumbers

on showNumbers
  lock screen; lock messages
  set the hgrid of fld rg to true -- adjust to your taste
  put the num of lines of fld rg into n0
  -- as an empty last line is ignored by LC:
  if char -1 of fld rg is cr then add 1 to n0
  put length(n0) into L
  set the borderColor of fld rg to "230,230,230"
  put 10+L*8 into ww
  repeat with i=1 to L
set the firstIndent of line 10^(i-1) to 10^i-1 \
of fld rg to -16-i*8
  end repeat
  set the margins of fld rg to (ww+10,8,8,8)
  set the liststyle of line 1 to -1 of fld rg to "decimal"
  if there is no grc rg then createNumBack rg
  show grc rg
  put the rect of fld rg into rct
  set points of grc rg to \
(ww div 2 + item 1 of rct, item 2 of rct) & \
(ww div 2 + item 1 of rct, item 4 of rct)
  set linesize of grc rg to ww
  unlock screen; unlock messages
end showNumbers

on createNumBack gg -- adust to your taste
  if there is no grc gg then create grc rg
  set style of grc gg to "line"
  set capstyle of grc gg to "butt"
  set opaque of grc gg to true
  set the colorOverlay["color"] of grc rg to "230,230,230"
  set blendlevel of grc rg to 70
end createNumBack

## known problem: incorrect 'rightalign' if after deleting the last line
##   the new last line is an empty one and the length of the num changes.
###END_OF_SCRIPT
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Line numbers for soft-wrapped styled text?

2017-03-28 Thread hh via use-livecode
I see, you are optimizing this. Will become perfect.

The current search is part of a script that has to work also for
non-wrapped text (with possibly horizontal scrollbar) and is a first
step for calculating the visible "chars" (incl. whitespace).

In sum: you are right, the search for the lines can/should be
optimised (you already show a way to go).

>From my point of view it has to be a rough estimate only, can be a
full line off, could stop after finding this 'top line' L1, using
then, say, L1-2 to be on the safe side.

*** My approach would then be to start calculating (or collecting, by
using the selectedLoc):
Walk through the string from there, line by line, as one needs the top
of each single 'visible' lines at any rate for the numbers display.
Then compare these found tops with the top and the bottom of the field
and decide when to start and when to stop. *** 

Of course, if one would like to know only the line numbers, then a 
binary search (optimised in your sense) for the bottomLine could/should
also be done.

This is essentially the same problem starting with a downward shifted
text. This again shows immediately that all your considerations are true
and will lead to an improvement.

So this could then use the same algorithm and adaptive guessing, returning
this time L2+2, to be on the safe side.

By the way:
The problem 'space-below' is probably a general problem of the current
text measurement, because for some fonts with extreme metrics ('Zapfino')
or others with wrong/incomplete metrics we have wrong measurement values.
This leads to the bug which I have seen (and seen reported as bug) that
the insertion cursor is up to a full line "off" (in direction top) and of
wrong height.

I'm looking forward to your complete solution. Perhaps one could even try
to draw a ruler with ticks at the exact line borders for styled text.

> Alex T. wrote:
> 

> 1. this uses a linear-interpolation for its initial guess for the 
> topline (i.e. the percentage, set to  vs / formattedheight). This is good.
> But it then uses that same value of percentage for the initial guess of 
> the bottomline - which seems totally wrong. Should it not use a 
> different percentage
> (specifically, the height of the field / (formattedheight - vs) with 
> maybe a minor tweak for margins) for starting on the bottomline calculation?
> 
> 2. After the initial percentage calculation, all the recursive calls 
> just revert to simple binary search (i.e. percentage = 0.5).
> Since the initial one is just an estimate, and can be thrown off by 
> variable line heights, this initial guess could be on the "wrong" side 
> of the actual answer - and hence all the rest of the recursive 
> iterations are done this "slow" way.
> Why not recalculate the percentage for each recursive call ?
> 
> 3. not so much a question as a bit of philosophical question 
>is a line "visible" if it occupies screen real-estate but has no 
> visible pixels on the screen ?
> i.e. the formattedRect has the same problem (if it is a problem) with 
> spacebelow as I mentioned earlier for formattedheight, so if the top 
> line within the visible field consists solely of the spacebelow a line, 
> then that line will not be included in the visibleTextLines().
> 
> Like I said, that's probably a philosophical question - but it does have 
> implications for how one could then set up the lineNumbers field; I 
> think you have to start it on the line before the "topline" form this 
> calculation, and then set the vscroll of the linenumbers field to match 
> the formattedrect of the next line of the original field (because you 
> can't set a negative vscroll value, so this is needed to push the first 
> visible line number downwards).


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Line numbers for soft-wrapped styled text?

2017-03-28 Thread hh via use-livecode
Hi Alex,
below you will find a tested binary search for the visible lines which
uses item 4 of the formattedRect for the topLine and item 2 of the
formattedRect for the bottomLine.

TMHO your method is so fast for visible lines of a field on usual
screensizes only that you could do that for each single of these lines.

The spaceBelow issue you describe has probably the (inavoidable) reason
of LC's ignoring a last linedelimiter in nearly all cases.

## The script is part of the result of a thread BerndN and I had once
## in the forum about the visible text of a styled field.
-- Determining the visible text lines of a field (may be styled).
-- pT = the short name of the field
function visibleTextLines pT
  lock screen; lock messages
  put the vscroll of fld pT into vs
  put the scrollbarWidth of fld pT into sw
  put the margins of fld pT into m
  put (m,m,m,m) into m -- now we have always at least 4 items
  -- 5 is the minimum textsize
  put  4 + (item 2 of m) + (the topof fld pT) into t
  put -4 - (item 4 of m) + (the bottom of fld pT) into b
  if the hscrollbar of fld pT then subtract sw from b
  put the num of lines of fld pT into n
  put vs/(the formattedHeight of fld pT) into pct
  put findTopLine(pT,pct,t-5,1,n) into L1
  put findBottomLine(pT,pct,b+5,max(1,L1-1),n) into L2
  return (L1,L2)
end visibleTextLines

-- percentage p% is a percentage of 1, for example p=0.5 (for 50%)

-- p=%, x=bott of fld pT, n1=start, n=max
function findTopLine pT,p,x,n1,n 
  put n1+trunc((n-n1)*p) into m
  if item 4 of the formattedRect of line (m+1) of fld pT >= x then
if item 4 of the formattedRect of line m of fld pT < x then
  return m+1
else
  if m <= n1 then return n1
  else return findTopLine(pT,0.5,x,n1,m-1)
end if
  else
if m>=n then return n
else return findTopLine(pT,0.5,x,m+1,n)
  end if
end findTopLine

-- p=%, x=bott of fld pT, n1=start, n=max
function findBottomLine pT,p,x,n1,n 
  put n1+trunc((n-n1)*p) into m
  if mn then return n
  if item 2 of the formattedRect of line (m+1) of fld pT > x then
if item 2 of the formattedRect of line m of fld pT <= x then
  return m
else return findBottomLine(pT,0.5,x,n1,m-1)
  else return findBottomLine(pT,0.5,x,m+1,n)
end findBottomLine

There is a bit of a problem I encountered trying to code this up.

I'm not 100% sure yet if it's a bug, though I think it must be. Comments 
anyone ?


> Alex T. wrote:
> If I set the 'spacebelow' of the last (Nth) line of a field, and get the 
> formattedheight of the field, that includes the spacebelow value just set.
> 
> However, none of
>the formattedheight of line N of fld ...
>the formattedheight of line 1 to N of fld ...
>the formattedheight of line 1 to -1 of fld ...
> include it.  The same is true of 'internal' lines - it's not just the 
> last one in the field - the formattedheight of a chunk doesn't include 
> any spacebelow set on the last line of the chunk.
> 
> This makes it near impossible to use a binary search accurately (or 
> indeed to reliably use "the formattedheight of chunk xx of fld yy").
> 
> So now that I've describe it like that, I'm pretty sure it is a bug  
> but comments welcome before I report it.
> 
> -- Alex.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Line numbers for soft-wrapped styled text?

2017-03-29 Thread hh via use-livecode
Alex,
before you waste valuable time:
The formattedRect can NOT be used in LC 7/8/9, because of the
(2^15 div 2)-limit for coordinates is active for that.

So the algorithm works in LC 6.7.11, but the results are sadly
'extremely' wrong in LC 7/8/9:
Crossing the 'limit' with a vertical coordinate jumps to negative
values for these coordinates. No chance to repair.

Using instead the formattedHeight of line 1 to N minus the
vscroll works. But it is not exactly doable if the last line is
empty (this is not added to the formattedHeight) = your space-below
problem -- a bug, TMHO.

I found another "dirty" but fast way to get pixel-exact line
positions for any field in LC 6/7/8/9. One could perhaps use it
until the text measuring problem is solved.

One needs a field that is transparent, is not threeD and has no
border (use instead an opaque rectangle with border as background).
Then set the hgrid to true (this has no visual effect if using as
borderColor the backColor of the graphic behind the field, for
testing I set the borderColor to red).
Now make a snapshot from the field and walk through the maskData
to search all such rows in the image that have a fully opaque
line. This is unique as long as the field has left and right
margins > 0.
This search in the image is *very fast* (< 2 ms), only taking the
snapshot and getting the maskdata needs some time (around 70 ms in
sum for 414x736 pixels).

A script that works here correctly with my tests is attached below.
It needs here in LC 9 about 120 ms for 4000 lines of heavily styled
text from the dictionary in a field of iPhone6 size (414x736).
Please change/improve/optimize it, especially the search part. This
is still the 'simple' binary search.

Hermann

You need a field "TEXT" (transparent etc, see above) and a
template-num-field "n00" (see my settings below as example).
Fields for feedback: "Range", "timing1", "timing2", "info"
= [1] The field's script
on textchanged
 updateNbs2
end textchanged

on scrollbardrag
 updateNbs2
end scrollbardrag
= [2] The numbering script (100 lines)
local nn="lineNumbers",l0,t0,b0,w0,h0,sw0,v0
local rg="TEXT", fw=32 -- num-field width

on updateNbs2
 lock screen; lock messages
 put the millisecs into m0  start
 put the top of fld rg into t0
 put the bottom of fld rg into b0
 put the left of fld rg into l0
 put the width of fld rg into w0
 put the height of fld rg into h0
 put the vscroll of fld rg into v0
 put the scrollbarwidth of fld rg into sw0
 set the properties of the templatefield to \
 the properties of fld "n00" -- see below
 if there is a grp nn then delete grp nn
 create grp nn
 set lockloc of grp nn to true
 set opaque of grp nn to true
 set backColor of grp nn to "204,204,204"
 set lockloc of grp nn to true
 set width of grp nn to fw
 set height of grp nn to the height of fld "text"
 set topleft of grp nn to l0-fw, t0
 set layer of grp nn to 1
 put the millisecs into m1  diff1
 put visibleTextLines()-1 into tL
 put the millisecs into m2  diff2
 put getLocs() into g
 put the millisecs into m3  diff3
 put "Lines: " & (tL,tL-1+the num of lines of g) \
  into fld "range"
 repeat for each line L in g
   put item 2 of L into i
   put ("n") into ni
   if there is a fld ni then delete fld ni
   create fld ni in grp nn
   set left of fld ni to l0-fw+2
   set top of fld ni to i-10
   put tL into fld ni
   add 1 to tL
 end repeat
 reset the templatefield
 put the millisecs into m4  diff4
 put (m4-m0 &"="& m2-m1 &"+"& m3-m2 &"+"& m4-m3+m1-m0) & \
 " ms" into fld "timing"
 unlock screen; unlock messages
end updateNbs2

function getLocs
 put the millisecs into m0 - start
 set topleft of img rg to \
 (5+the right of fld rg, the top of fld rg)
 put w0-sw0 into w1
 put the millisecs into m1 - diff1
 export snapshot from fld rg to img rg as PNG
 put the millisecs into m2 - diff2
 put the maskdata of img rg into mData
 put the millisecs into m3 - diff3
 put NumToByte(255) into c1
 repeat 1+log2(w1)
   put c1 after c1
 end repeat
 put byte 1 to w1 of c1 into c00
 put the millisecs into m4 - diff4
 repeat with i=1 to h0
   put (i-1)*w0 into i0
   if byte i0+1 to i0+w1 of mData is c00
   then put cr&(0,t0+i) after s
 end repeat
 -- avoid overlapping:
 -- put (0,min(t0,10+item 2 of line 1 of s)) before s
 put cr & (0,max(h0+t0,10+item 2 of line -1 of s)) after s
 put s into fld "info"
 put the millisecs into m5 - diff5
 put (m5-m0 &"="& m2-m1 &"+"& m3-m2 &"+"& m5-m3+m1-m0) & \
   " ms" into fld "timing2"
 return char 2 to -1 of s
end getLocs

function visibleTextLines
 lock screen; lock messages
 put the selectedChunk into sc
 put the scrollbarWidth of fld rg into sw
 put the margins of fld rg into m
 put (m,m,m,m) into m -- now we have at least 4 items
 put the num of lines of fld rg into n
 put findTopLine(v0+t0-1+item 4 of m,1,n) into L1
 return L1-1
end visibleTextLines

Re: Overlaying on video

2017-03-27 Thread hh via use-livecode
> Roger E. wrote
> Will there be a similar capability to allow objects (buttons and fields)
> to overlay a browser widget, which might also be displaying a video?
> I believe there is a need to make this possible for any situation.

As I'm currentl refershing my 'web-knowledge' I made a demo.

An overlay by a LC window. You can set its transparency and could even
use this technique to make windowshaped 'overlay-stacks' (so that you can look
through and click through the 'holes' of that stack).

Widget usage example #3
http://forums.livecode.com/viewtopic.php?p=152773#p152773

It's not perfect, you will have to add scripts, but the HTML is fully included.
Stack size (incl. browser widget and HTML+CSS+javascript) < 30 KByte.

May be this is not really what you want, but TMHO an overlay by a lot of single
objects will slow down the performance of the video dramatically.

HTH, Hermann
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Line numbers for soft-wrapped styled text?

2017-03-27 Thread hh via use-livecode
The solution of Alex T. was the first example I saw of a useful
usage of the styledText array. TMHO this is the way to go for the
future of more and more complicated styled text.

As was said elsewhere, there could be a considerable speed up if
first the visible range of lines, say numbers L1 to L2, is determined.

We had once a thread in the forum about that. The fastest method:

Compare the formattedHeight of line 1 to L of fld T to the vscroll v0
of fld T. Not by walking with L up from one, but by using a binary
search for L1 and then starting from there to find L2 by comparing to
v0+the height of fld T. This needs only a few millisecs even for large
chunks.

Then use Alex's method with the styledText array of these lines. Or,
quick and dirty, save the selectedChunk, select before each line L
in the range L1 to L1 and collect the selectedLocs and then restore
the selectedChunk.

Now draw the line numbers each into an own freshly created field or
use Alex's space below method.

p.s. Hopefully you will share your final code.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Colour Manipulation

2017-03-25 Thread hh via use-livecode
Hi all.

Today I implemented this as part of LCImageToolBox89: Basics.

Get it _from LC 8/9_ via "Sample Stacks" of the LC-Toolbar or
http://livecodeshare.runrev.com/stack/826/LC-ImageToolBox89%3A-Basics

Uses Canvas2D (no webGL because of issues with some graphic cards)
in a hidden browser widget. Your method gives nice Effects and works
with a decent graphic card pretty fast. Needs here with LC 8/9 on a
Mac mini 2.5 GHz/IntelHD4000 for a 1920x1080 image < 500 millisecs.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Widget usage examples

2017-03-25 Thread hh via use-livecode
Widget usage example #2: LC-ImageToolBox89_Basics
http://forums.livecode.com/viewtopic.php?p=152723#p152723

You will be astonished how close the core of the javascripts is to the
handling of imagedata in LCScript. There are a lot among you who will
add and change effects without knowing javascript, simply by using an
existing function as 'template' (and use a correct 'header' and 'footer'
around it).

Using LC 8.1.3/9.0.0-dp6 the stack runs (tested) well on
Mac 10.12 and Win 7/10, depends also on your CPU/GPU combination.

On Linux (Mint 181c) I got sadly the well-known "linux-something-dialogs".
I hope that somebody has on linux more success and/or can help me to work
around this bug of the browser widget.

> Widget usage example #1: Ken-Burns-Effect 
> http://forums.livecode.com/viewtopic.php?p=152547#p152547

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Colour Manipulation

2017-03-19 Thread hh via use-livecode
> Jonathan L. wrote:
> It would be amazing if the LC folks created an ImageMagick wrapper so that
> we could use it as an external or widget!

There is a Java interface (JMagick, see 
https://www.imagemagick.org/script/api.php)
and the brand-new LiveCode FFI for Java.

> If you can find a Javascript library that does what you need, your mission
> would be easy :)

You can handle imagedata in HTML5/canvas2D very similar to LiveCode or use 
webGL.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Widget usage examples

2017-03-19 Thread hh via use-livecode
Today I started a new collection, hope some of you come in with "LC-specials".

This demo shall show that you need nothing more than a browser widget and a
set of image files located locally (e.g. in tmp-folder from stack resources)
or from a server in order to have a HQ Ken-Burns-effect show -- just try.

The stack is essentially a GUI to an effect implemented by John@Toymakerlabs
(http://www.github.com/toymakerlabs/kenburns/).
After your parameter settings are done, the stack creates a _self-contained_
htmlText-copy for you, you don't need to collect several files. Just copy,
(use a button) drag a browser widget to your stack, name it "KenBurns",
paste to a field named "HTML" and set the htmlText of widget "KenBurns" to
field "HTML" to have your own show. See the stack and a description here:
 
Widget usage example #1: Ken-Burns-Effect
http://forums.livecode.com/viewtopic.php?p=152547#p152547

Using LC 8.1.3/9.0.0-dp6 the stack runs (tested) smoothly a 960x540-show on
Mac 10.12 and Win 7/10. On Linux (Mint 181c) I got sadly soon the well-known
"linux-something-dialogs". I hope that somebody has on linux more success
and/or can help me to work around this bug of the browser widget.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Widget usage examples

2017-03-20 Thread hh via use-livecode
> BR wrote
> Now, if only we could layer objects on top. I'm seeing more and more apps now
> that are using this kind of effect as the background, they also use looping
> video - not animated gif, but actual video: short small looping clips that
> run behind/ underneath a scrolling group of buttons or rows.

Didn't you see the mouseCoords in the LC field while moving the mouse over the
browser? Just do the layering in javascript and call LC by js-handlers.

And moreover: As soon as more than 20% of all apps use this it will become 
boring.
The next coloured cat is already entering the main street.

The smoothness is due to accessing the hardware not a result of using a special
language (although in this case the brilliant combining of CSS and javascript by
John at Toymakerlabs is very important):
If you try such an effect for example in a virtualbox that has < 50% of your GPU
and/or a small amount only of your CPU then you will have stuttering...

How should LC achieve all that native accesses and cross platform handling with
its small developer group? You compare to results that are done (in sum) by
hundreds of specialised developers!
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Widget usage examples

2017-03-20 Thread hh via use-livecode
Hi Jonathan,

the problem is the slowdown/stuttering because base64 encoding
increases data sizes by round 30%. To avoid a huge html file I had
to use an extra callback for that. The other method I described
is simpler and faster anyway and can easily be LC-scripted.

As this is a widget usage example, that is more a 'snippet' than
an app, I decided to leave it (from the LC part) simple as it is.
Anyway thanks for the help.

Not sent from an iPhone ;-)

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Widget usage examples

2017-03-20 Thread hh via use-livecode
Correction.

My widget usage example (Ken-Burns-Effekt)
http://forums.livecode.com/viewtopic.php?p=152547#p152547
misses one feature I have announced:

The images list is currently only working if you use image files from
a server (may be also a local server). My variant for local files was,
not in the stack yet, to translate local URLs of the form "file://"
into a data source of the form "data:image/png;base64,...").
But this doesn't work coreectly, as it is, with the current javascript.
As this should be a clean example, the original by John @ Toymakerlabs
only changed in parameter settings, this kind of "local loading" is
delayed to a future usage example. Sorry.

*** But this works for a usage without a (local) server: ***

Hit the button "COPY" while the show (adjusted to your taste) is running
and write the clipboard (= the htmltext of the widget) out to a local
".html"-file. Then use images from a folder relative to that file (server
is also allowed):
You can for setting image pathes and descriptions edit the html file at about
line 500. Then set the URL of your widget to that local file ("file://...").

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Negative Numbers and NumberFormat

2017-04-04 Thread hh via use-livecode
>>> Bob S. wrote:
>>> You should rather say the number format determines the num of DIGITS. 
>> hh wrote: 
>> That's what you wish to have (good idea). But it's not like that, its 
>> the length of the number as string. 
> Bob S. wrote
> Really? Then why does :
> set the numberformat to 0.0; put -.1 + 0 result in -0.1 ?  

You are mixing input methods and output methods.

"-.x" (or ".x") is allowed as input, but then converted to
"-0.x" (or "0.x"). Just the same for "00.x" or "-00.x"

*After* that the numberformat is applied (and doesn't cut if leading is
longer). That's why

  set the numberformat to "0.0"
  put 0-".1", 0+"-0.1", 0+"-00.1" after s -- you may leave out quotes
  set the numberformat to "00.0"
  put 0-".1", 0+"-0.1", 0+"-00.1" after s -- you may leave out quotes

both yield -0.1,-0.1,-0.1 (in LC 6/7/8/9).

To see more clear the string length is applied to the number:
You can use _ANY_ other one-byte-char other than the separator (".").

set the numberformat to "ab.c"
is equivalent to
set the numberformat to "00.0"

This is comfortable if you wish to have the numbers length
dependent on any string varibale's length:

  put "Bob.S" into str
  set the numberformat to str
  put 0-12 & " _and_ " & 0+13

yields -12.0 _and_ 013.0, as I said (in LC 6/7/8/9).

*** Once again, I like and support your idea. ***
But I suggest to name it a feature request, not a bug:

Perhaps the option to apply the numberformat to the absolute value
only and choose/apply a prefix: either +, -, space or empty?
The empty is for people who distinguish negative and positive nums
by labels only (debit and credit) or colors only (red and black).


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Negative Numbers and NumberFormat

2017-04-03 Thread hh via use-livecode
> Bob S. worte:
> I have a function for calculating the difference in time

Then you mean -(01:00:00) and not (-01):(00):(00), quite different.

AFAIK most languages do such time evaluations as follows
1) compute the time in seconds,
2) convert its absolute value to time format, and
3) if negative, put "-" before the formatted time.
That is, the whole display is not an immediate result of setting the
number format.

> You should rather say the number format determines the num of DIGITS.

That's what you wish to have (good idea). But it's not like that, its
the length of the number as string. You gave the proof yourself.
It's the same with the number formats from format(). Probably LC uses
internally format() for its numberFormat.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: [ANN] Release 8.1.4 RC-1

2017-04-04 Thread hh via use-livecode
> Panos M. wrote:
> Dear list members,
> We are pleased to announce the release of LiveCode 8.1.4 RC-1.

Bugs fixed (among others):

Lock cursor works again ...
Layering is correct again ...
The formattedRect works now also for 16 bit coords ...

Thank you very much LC-team, especially for that!

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: New Features?

2017-04-03 Thread hh via use-livecode
Interesting thread about scalefactor (lower half is your issue):

http://runtime-revolution.278305.n4.nabble.com/scaleFactor-strangeness-tc4697399.html#none

>Dan F. wrote:
>Anyone know where to write LC for a feature request?
>In case your curious…  Don’t know if it’s possible or not, but I want to 
>request the >abliltiy to set the scaleFactor of a object (specifically a group 
>of objects).


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Release 9.0.0-rc1

2017-03-31 Thread hh via use-livecode
I can't sleep. The new LC 9.0.0-rc1 features make me crazy.
Close to infinity. Converting all my stacks since two hours.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Line numbers for soft-wrapped styled text?

2017-04-02 Thread hh via use-livecode
Alex,

a brilliant technique. It is certainly usable for other "searching"
tasks. And it simply needs for this use case a faster measurement-method
as input. We could try the selectedLoc:

The script below gets for me the exakt topLefts of the visible ones of
2 "worse case"-lines in < 1 second, with LC 9, and in LC 6 it is
three times faster, on a medium fast machine (2.5 GHz macMini).
I'm sure you can take the following quick and dirty routine again down
to at least 50% of needed time with your optimization technique.

Hermann

## Commented for occasional readers.
## You still has to use the locations for a numbers display: Use either
## one num-field per line or one for all using Alex's method of space below.

local rg=TEXT", l0, t0, b0, v0
local gpoints -- collects the toplefts of the lines

on updateNbs2
  put the millisecs into m1
  lock screen; lock messages
  put the top of fld rg into t0
  put the left of fld rg into l0
  put the bottom of fld rg into b0
  put the height of fld rg into h0
  put the selectedChunk into sc
  put the vscroll of fld rg into v0
  put the num of lines of fld rg into nL
  put visibleTextLines(nL) into tL
  put "Lines: " & tL & " of " & nL into fld "range"
  put gPoints into fld "info" -- ready to use
  -- avoid bug(?) with the field num:
  if sc is not empty then
do ("select "& (word 1 to 4 of sc) &" of fld "& rg )
  end if
  set the vscroll of fld rg to v0
  put (the millisecs-m1) & " ms" into fld "timing"
  unlock screen; unlock messages
end updateNbs2

-- returns the visible lines range and (in gPoints) the toplefts
-- n is the num of lines
function visibleTextLines n
  put the scrollbarWidth of fld rg into sw
  put the margins of fld rg into m
  put (m,m,m,m) into m -- now we have always at least 4 items
  put findTopLine(v0+t0-1+item 2 of m,1,n) into L1
  put L1-1 into L2; put v0+b0+6-item 4 of m into x
  put empty into gPoints
  -- now a simple line-after-line check could/should be made faster,
  -- its advantage: We get at the same time already the locations!
  repeat while L2 <= n
add 1 to L2
set vscroll of fld rg to v0 -- important for measuring
select before line L2 of fld rg
put item 2 of the selectedLoc into slc
put cr & (l0,slc) after gPoints -- adjust here the left
if (the vscroll of fld rg) + slc > x then
  put line 2 to -2 of gPoints into gPoints
  exit repeat
end if
  end repeat
  return L1,L2-1
end visibleTextLines

-- the simplest recursive method as base for optimization
function findTopLine x,n1,n -- x=top pixel value, n1=start, n=max
  put n1+((n-n1) div 2) into m
  set vscroll of fld rg to v0
  select before line m+1 of fld rg
  put the vscroll of fld rg + item 2 of the selectedLoc into vsl
  if vsl >= x then
set vscroll of fld rg to v0
select before line m of fld rg
put the vscroll of fld rg + item 2 of the selectedLoc into vsl
if vsl < x then return word 2 of the selectedLine
else
  if m <= n1 then return n1
  else return findTopLine(x,n1,m-1)
end if
  else
if m >= n then return n
else return findTopLine(x,m+1,n)
  end if
end findTopLine

## The field's script is again:
on textchanged
  updateNbs2
end textchanged

on scrollbardrag
  updateNbs2
end scrollbardrag
### END_OF_SCRIPT

> Alex T. wrote:
> Sure, here it is.
> 
> I couldn't resist doing some simple benchmarks, just to verify my 
> intuition. Very glad I did.
> 
> OK - here's the theory :
> 
>   we're using variations of binary search to find the lowest numbered 
> line that is visible, and then again to find the highest numbered line.
> 
> So at each stage we have an interval within which the right answer must 
> lie.
> 
> 1. Simple binary search : the next guess is the middle of the current 
> interval.
> 
> This is simple, and very consistent for the number of guesses needed: 
> the worst case is almost identical to the average/typical.
> 
> For my test case (25000 lines of heavily styled text), we need approx 14 
> guesses for the first calculaiton, and 8 for the second.
> 
> 2. Simple Newton-Raphson (linear interpolation).
> 
> This is usually better than simple binary, *if* there is a reasonable 
> correlation between the measurable values and the guessable values. In 
> this case there - the height of any chunk of lines is reasonably 
> correlated to the number of lines, though not exactly in all cases.
> 
> Usually this will take significantly fewer guesses (and in this case it 
> takes around 8 + 4 compared to the 14+8 above).
> 
> BUT - the worst case can be much, much worse :-(   Imagine a field with 
> 1000 lines - the first 500 are in 5-point text, and the other 500 are in 
> 1000 point text, scrolled forward by 400 lines; this makes our guessing 
> VERY poor, and will take up to 200 or more guesses.
> 
> 3. Use a mix of linear interpolation and binary search. I tried simply 
> alternating them - one calculated guess, then one 'average' guess, then 
> another calculated one, 
> 
> This 

Re: AW: vertical text?

2017-04-12 Thread hh via use-livecode
> Jonathan L. wrote:
> This is also easy to do in a browser widget, if you don't mind
> the "always on top" aspect of browser widgets.

Right, but only to a certain degree.

LC Builder has _a lot_ of possibilities different from using the
javascript of a browser widget.

The very basic widget linked above, for example ...
... allows the user to select _any_ textfont on _his_ system
or available in the stack.
... can have everything outside the rotated box transparent.

Both is not doable in a browser widget (and not by _any_ browser).

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


AW: vertical text?

2017-04-12 Thread hh via use-livecode
Hi Tiemo,

LC Script gives you only the possibility to have a rotated _image_
of "real" horizontal text.

In LC Builder you have the possibility for rotating "real" horizontal
text itself (use your font and size), not only a snapshot.

Here is an easy example how to do that
http://forums.livecode.com/viewtopic.php?p=148690#p148690

This is an lcb file (it has to be the only lcb-file in its folder.
Then open it in the 'Extensions Builder' and hit "Test").
Create your own widget from it.

Hermann

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Negative Numbers and NumberFormat

2017-04-06 Thread hh via use-livecode
You forgot to give examples for Bob's original problem?
The negative numbers ... ;-)

> Paul D. wrote:

>> put format("$%0.2f",tMoney) into msg
>> 
>> for tMoney = 5.55, you get $5.55
>> for tMoney = 5.3, you get $5.33
>> 
>> want a space between the $, then use
>> put format("$ %0.2f",tMoney) into msg
>> 
>> want a leading zero and minimum of 2 digits before the decimal point
>> put format("$ %05.2f",5.553) into msg

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Standalone Magnify Problem

2017-04-06 Thread hh via use-livecode
> Peter R. wrote:
> I have it working fine when I'm in the development environment
> but it's not working reliably in a standalone app. 

a) Did you already check to have the same paintcompression in both environments?
b) If you make such large images (why?) you may get a conflict with the 
8bit-coords
limit. May be the standalone engine has still more of such limits included for 
'formatted'-measurements than the IDE.
c) Did you already check to have the same resizequality in both environments?
("best" may create an alphachannel)
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: numberFormat affecting array keys???

2017-04-20 Thread hh via use-livecode
> Bob S. wrote:
> Okay THAT has GOT to be a bug!!! Why the hell is numberformat modifying the
> name of the array element?? I haven't done ANY math on it.

"repeat with i=1 to 10" uses i to count from 1 up to 10 step 1: That's a lot
of math you've done to i.

Whereas this doesn't touch the numbers:

  set the numberFormat to "00"
  put 1 into myArray[1]
  put 2 into myArray[2]


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: numberFormat affecting array keys???

2017-04-20 Thread hh via use-livecode
> Bob S. wrote:
> Okay THAT has GOT to be a bug!!! Why the hell is numberformat modifying the
> name of the array element?? I haven't done ANY math on it.

"repeat with i=1 to 10" uses i to count from 1 up to 10 step 1: That's a lot
of math you've done to i.

Whereas this doesn't touch the numbers:

  set the numberFormat to "00"
  put 1 into myArray[1]
  put 2 into myArray[2]


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Weirdness with filter (maybe?)

2017-04-20 Thread hh via use-livecode
There is also brilliant work optimized for LC syntax.
By the one and only LC-master of regex, Thierry:

https://sunny-tdz.com/livecode/sunnyrex

> Bob S. wrote:
> Filter, unlike matchtext, in the form you are using, is not using regex. 
> There is a form of
> filter however that does. If you need help with a regex expression, I use a 
> neat little tool
> called RegexMagic. 30 day demo and not too expensive if you use regex 
> expressions on a regular
> basis. (See what I did there?) 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Browser widget on linux

2017-04-13 Thread hh via use-livecode
>>> Richard G. wrote (in the 'vertical-text'-thread):
>>> On disk the Linux build of CEF takes up 135 MBs, and like any
>>> browser I would imagine it more than doubles RAM requirements
>>> for an app using it.
>> hh wrote:
>> I would even give a full Gigabyte of RAM if this could make the
>> browser widget work on linux ...
> Richard G. wrote:
> had pretty good luck on Ubuntu 14.04 64-bit - what's your setup?

Richard, I moved this to a new thread, fitting more the subject. Hope
it is OK for you. Thanks that you came in.

After your report I was full of hope that the three years old ubuntu
14.04.5 and LC 8.1.3 or 8.1.4-rc1 would yield a fully functional
browser widget. Installed in a fresh setup Ubuntu 14.04.5 and fresh
LC 8.1.3/8.1.4-rc1/9.0.0.-dp6 (all 'for this user only').

Running 8.1.3-64bit it is better than the others tested below in that
it _randomly_ works correct and doesn't show bug 3 below (yes, bugs 1
2 too). If not working it instead creates several additional processes
libbrowser-cefp.
And it  creates with every startup fresh preferences, declaring the old
one as corrupt. Running 8.1.3 on Ubuntu 14.04.5-32bit is the same as
described below.

Within the last two weeks I tested the following, on real hardware
(additionally some on on virtualBox):
*Latest LTS* of Ubuntu (also Xubuntu, Lubuntu, Mint), Debian, Fedora.

In sum 10 trials (6 on 64bit, 4 on 32bit). All OSes are running without
problems. LC 8.1.3, 8.1.4-rc1, 9.0.0-dp6 runs and works using LC Script.

** But I had _NO_SUCCESS_ in these 10 trials with a browser widget.
** I wonder if anybody ever tested the _full_ functionality of the
** browser widget on a newer LTS linux flavour.

Full functionality means that you can *do* javascript in the browser.
You can't even come into a state to test that: These severe 'bugs'
are common to _all_ my trials (incl. on Ubuntu 16.04.2):

Bug 1: Open a new stack, drag a browser widget symbol from "Tools".
The widget portion of "Tools" disappears. Mostly LC hangs after that,
you need the system monitor or a terminal to kill it.

Bug 2: Open a new stack, create a browser widget by LC-menu or script.
Try to open the property inspector. No reaction.
Try to quit LC. The "something-dialog" burns onto your screen. LC hangs
after that ... (as above).

Bug 3: Open a stack with an included widget that runs on Mac and Win on
all systems that run LC 8/9 (for example: "Browser widget on linux
or "Sample stacks/Browser widget image manipulator" or "Sample stacks/
LCImageToolbox89").
At latest after the second load LC hangs, you need the system monitor
or a terminal to kill it and it's "something-dialog".

I'm deeply disappointed about these extreme results, especially because
we know  that several members of the core team also use linux on their
own machines.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Browser widget on linux

2017-04-14 Thread hh via use-livecode
Hi all.

Panos linked to the following bug report (it is more a discussion):

http://quality.livecode.com/show_bug.cgi?id=16848

The final 'workaround' there by Max Vessi solves several issues on linux.
The property inspector, the script editor, the dictionary and the browser widget
work correcly with that (I tried latest LTS of Ubuntu/Xubuntu/Lubuntu/Mint and
Debian and Fedora).

The trick is to launch LC by a shell script (here if LC Indy 8.1.3 is installed
'for this user only'):

#! /bin/bash
export LC_ALL= LC_NUMERIC=C 
export LIBGL_DRI3_DISABLE=1
"/home//.runrev/components/livecodeindy-8.1.3.x86/LiveCode\ Indy.x86"

** Thanks Max for elaborating this shell-script! **

I used the long path for the home because some desktop environments crash when
using tilde instead.

A utility stack for using this together with a ".desktop"-file is available in
the forum, so that one can launch after that LC "as usual":

http://forums.livecode.com/viewtopic.php?p=153351#p153351

It is there also described in detail for all of you who don't use linux as the
main OS, like me (but I switched already a main dev-machine to Mint-Cinnamon) 
and
prefer to do things 'manually'.

Why all the big fuss about that?

Just try "LC ImageToolBox89: Basics v103" (use livecodeshare or 'Sample 
stacks').
If you have a decent graphic card, you'll see an image processing speed that is,
compared to LC Script, _extremely_ fast. It handles images of screensize in less
than one second. This is also true for convolution kernels of size up to 7x7 and
color matrices. The latter is nearly finished and I'll make it soon available.

This shows from my view the biggest progress we could make with image processing
in LC in the last years. And LC 8/9 works fine with it, on Mac/ Win/ linux!!

Once again thanks to Jonathan Lynch for hinting to this application possibility 
of
the browser widget by his affine transform examples (see livecodeshare or 
'Sample
stacks').
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: AW: vertical text?

2017-04-12 Thread hh via use-livecode
> Richard G. wrote:
> On disk the Linux build of CEF takes up 135 MBs, and like any browser I
> would imagine it more than doubles RAM requirements for an app using it. 

I would even give a full Gigabyte of RAM if this could make the browser
widget work on linux ...

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Browser widget

2017-04-23 Thread hh via use-livecode
Yes, see

Dict:API:Browser
or
tinyDict:Dicts:Browser

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Legofied thistle

2017-04-23 Thread hh via use-livecode
In order to follow the current Lego-Hype of LC's advertising you may
create an own 'legofied' version of the thistle that thistles at
Thistle street NW, Edinburgh.
To have a playground for the little version-boys from LC's homepage...

http://forums.livecode.com/viewtopic.php?p=153583#p153583

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Working browser widget/linux-flavour combinations?

2017-03-09 Thread hh via use-livecode
I would like to test some browser interaction on linux.

Please, could someone who works with a LC version that has NO
problems with the browser widget tell me this working 32/64 bit
LC version - linux flavour combination?

Thanks in advance.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Searching "teh" or tihs"

2017-03-09 Thread hh via use-livecode
Searching is important for your project?
Would you like to ask "Did you mean the?" if user searches "teh"?

I've implemented a fuzzySearch algorithm in LiveCode script:
http://forums.livecode.com/viewtopic.php?p=152202#p152202

Now if you wish to look up "the" or "this" then fuzzySearch will find
it (among others) by searching "teh" or tihs", with a penalty score of
one only for swapping the chars. 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Searching "teh" or tihs"

2017-03-09 Thread hh via use-livecode
> Peter Bogdanoff wrote:
> This looks intriguing! I’m working on a commercial project that
> could use this. What is your license?

The code is based on pseudocode from
https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance

From my side it's free for non-commercial use, I only wish to have
a citation.

For commercial use of my published scripts I would like to have
1. a citation
2. an "At-least-donation", one time, for the
+ CFFL = Community Fund for LiveCoders: +
For such LiveCoders who help the community such a lot in the forums
or here in the list and who really _need_ some money (I know some).

The donation for this script here should be _at least_ $10 (one time).

The fund is a new idea.
Certainly Richard Gaskin is willing to manage such a fund (assuming he
doesn't need such funding). OK Richard?



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Working browser widget/linux-flavour combinations?

2017-03-09 Thread hh via use-livecode
Thanks Richmond.

There are bug reports from Sept 2016 reporting this 'something'-answer you
describe above.

I tested with Mint 173 to latest, 32bit. Always had to kill LC 8/9 after the
the something-dialog, exactly as reported to LQCC (#17715 and links there).

I can not believe that nothing changed since then: The browser widget is a
'showcase'-member of all LC advertising. Should at least basically work.

> Richmond wrote:
> Xubuntu 16.04 64-bit, 8.1.3: "something". Had to KILL Livecode.
> As above, 9.0.0 DP-6: no obvious difference. Tut, tut, tut.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Working browser widget/linux-flavour combinations?

2017-03-09 Thread hh via use-livecode
> Mark Wieder wrote:
> ... worked in 9.0-dp6 ... 64-bit Linux Mint 17.3 cinnamon.

So I tried Mint 173 cinnamon 32 bit and Mint 181 cinnamon 64 bit,
used LC 8 and LC 9, in Virtualbox on Mac and on a 64 bit Linux box.

Both show with the browser widget the "something"-window that Richmond
described and LC is to be 'killed' after trying to use the widget.

Now launching from Terminal with Panos' advice
( LC_ALL= LC_NUMERIC=C "path/to/livecode_executable" )
brings up a widget, yes. But this works sadly only "halfway":

No context-menu, not even for navigation, no connection to localhost
possible, limited HTML5 support (some files don't work which work in
Win and Mac without any problem).

Is the widget not a 'modern browser' in linux? Or is the installation
of special lib-files required to have it fully working? 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Messages sent while mouse is down?

2017-03-11 Thread hh via use-livecode
Although there is one scenario where one has to use Mike's looping
"within"-approach (adjusted to collecting, not exiting the repeat):

If the controls in question (may be all) have some overlapping areas:
controlAtLoc((x,y)) reports only the control at (x,y) with the
highest layer.

> JLG wrote:
> You could also try controlAtLoc() which would avoid the loop.

> MB wrote:
> on mousemove
>-- just using control number for the quick example
>put 1 & cr & 2 into objectList 
>if the mouse is down then
>   repeat for each line tLine  in objectList
>  if within(control tLine,the mouseloc) then
> put tLine into tResult
> exit repeat
>  end if
>   end repeat
>end if
>if tResult is not empty then
>   put tResult
>else
>   put "no result"
>end if
> end mousemove


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC for Raspberry Pi

2017-03-11 Thread hh via use-livecode
Richard.

Thanks for your engagement. I would like to second this with 98%.

Let me correct two of your statements (the missing 2%).

1.
> RG wrote:
> The last RPi build was v704, which is generally good with one critical 
> issue:  a bug in the menu handling routine causes a crash when clicking 
> in a menubar.
That's wrong in that generality. I have four Raspi's running
(one A with Debian, two B+ with Lubuntu or Debian resp., one 3 with Xubuntu
or Debian resp., the Debian needs to be first installed on a 2B+, see forum).
So install an appropriate OS and it works. Though 3-5 imes slower than v651.

2.
> RG wrote:
> So for me, if I had to deliver a GUI for RPi I'd much rather use a workflow
> similar to what we do with mobile:  develop on a fully-spec'd desktop 
> machine, and deploy to the device.

If "I'd" means "I would" then I'd say once again (I told you in the forum):
This is the way I did from the beginning of the existence of __LC 704__,
which is the only one that has a Raspi-deployment option (Linux ARMv6-HF).
Simply copy the standalone created on your desktop box to your Raspi via sftp
(what may be even scripted) or via an USB stick.

So if developers optimize for speed (as LC 7 is 3-5 times slower than LC 6)
they can have this, since years. By ONE click and ONE data transfer.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC for Raspberry Pi

2017-03-12 Thread hh via use-livecode
People who are using a Raspi and try or even use LC on it may be inclined to
try or use LC if they 'expand' to a tablet or desktop.

And their own creations will work after no or small adjustments, WOW. This
may cause (delayed) revenue to LC.

> Mike K. wrote:
> Pi is interesting to me because of what I can, in theory, build with it,
> but for the same reason so are many other things.  Pi isn't going to bring
> revenue to LC, IMHO, the way that some of those other tools can, but being
> able to brag about being the easy-to-use IDE for PI would be cool.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Searching "teh" or tihs"

2017-03-10 Thread hh via use-livecode
1. The algorithm I implemented is for "fuzzy search" of written/typed words,
not for "similar sounding words" (soundex), mostly quite different. My demo
is scripted for looking up a (mistyped) search string in the 3233 keywords
of LCScript.

2. That's for me the true value of LiveCode:
Don't talk about possible development -- just do it. Then you have in a few
hours a solution which is working on Mac/Win/Linux, using LC 6/7/8/9, and
often fast enough even for RaspberryPi 2/3. Independent of current OS flavours.

If that solution is not good enough or not fast enough for you then you can
write C or java extensions. We have already a Java FFI available in LC 9-dp6!
I'm really looking forward to your solution.

In the meantime you can use my approach, it was updated today. I removed a
small bug in the percentage search, which wasn't sloppy enough ;-)

> Bob S. wrote:
> There is always the soundex() sql function. SELECT soundex('the') = 
> soundex('teh') returns true. Not sure what the tolerance is though. Because 
> of the arbitrary nature of languages, this really requires a lookup table for 
> commonly mistyped words, with the ability to "learn" as corrections are made. 
> Then you would need to be able to "uncorrect" or delete entries. Eventually 
> you end up with something that is likely built into the OS already, so at 
> that point it would be better to write an extension in C or Java. 
> 
> Bob S
> 
> 
> > hh wrote:
> > 
> > Searching is important for your project?
> > Would you like to ask "Did you mean the?" if user searches "teh"?
> > 
> > I've implemented a fuzzySearch algorithm in LiveCode script:
> > http://forums.livecode.com/viewtopic.php?p=152202#p152202
> > 
> > Now if you wish to look up "the" or "this" then fuzzySearch will find
> > it (among others) by searching "teh" or tihs", with a penalty score of
> > one only for swapping the chars. 
> 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Dragging widgets

2017-02-28 Thread hh via use-livecode
> Richmond wrote:
> So . . . can any one tell me how to effect a "grab" (which is the same 
> whether with a PNG image, a button or a graphic object) with a widget?

There is one way that is acting similar to a "grab": Put the following
into your card's script. Works for widgets and any 'usual' control that
doesn't block mouseDown.

on mouseDown
   if the short name of the target is "svgTURTLE" then # <-- use any filter
  put the mouseControl into mC; put false into mUp
  put the clickH - item 1 of the loc of mC into dx
  put the clickV - item 2 of the loc of mC into dy
  repeat until the mouse is up
 set loc of mC to (the mouseH-dx,the mouseV-dy)
  end repeat
end if
end mouseDown

Using a "send in time" is not possible for that, because the click is then
passed 'in between' to the control/widget. You sadly have to poll the mouse.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Negative Numbers and NumberFormat

2017-04-03 Thread hh via use-livecode
TMHO, this could be a feature request rather than a bug report.
The zeros in the number format determine the num of characters
and "-" is one.

Also we have -0 = 0. So what about "-01:-00:-00" ??

> Bob S. wrote:
> "-01:00:00"?
> Yes I expected this. It's not that I cannot work around it,
> it's just that it seems it ought to put 2 zeros where 2 zeros
> are specified in the numberFormat and if it doesn't and should,
> then I will file an (admittedly low priority) bug report. 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Script to find bottom of lowest field

2017-04-03 Thread hh via use-livecode
on mouseUp
  put 20+maxbottom()
end mouseUp

-- note: invisible or hidden fields are included
function maxbottom
  repeat with i=1 to the num of fields of this card
put the bottom of fld i of this card into b[i]
  end repeat
  return max(b)
end maxbottom


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Line numbers for soft-wrapped styled text?

2017-04-01 Thread hh via use-livecode
> Alex T. wrote:
> I set out to optimise the 'visibleLineNumber' function, and succeeded
> in getting it down to approx 20% of the original version, by:
> - reduce from 2 to 1 height calculations per iteration
> - convert from recursive to iterative
> - use Newton-Raphson style linear interpolation, with tweaks to avoid
> the pathological end cases
> - optimise the start values for finding the last visible line based on
> the effective field height and min allowed text size

Alex,
please think about posting this. It is certainly valuable for other use
cases.

Hermann
(This post is NOT an April 1 - joke)

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC-Magick Collection

2017-04-06 Thread hh via use-livecode
Added today #8: MoonEffect (Elliptical distortion/ Fisheye)
Antialiasing part by 'BNig'(Bernd), Distortion part by 'hh'(Hermann).
http://forums.livecode.com/viewtopic.php?p=153159#p153159

This is our "easter-egg" for the LC Community!

> LC-Magick #7 - Cuboid (3D-Box 'wearing' images) (Hermann H.)
> http://forums.livecode.com/viewtopic.php?p=153076#p153076
> LC-Magick #6 - Bilinear Perspective Image Distortion (Hermann H. and Bernd N.)
> http://forums.livecode.com/viewtopic.php?p=150757#p150757
> LC-Magick #5 - Circular (Polar) Image Distortion (Hermann H. and Bernd N.)
> http://forums.livecode.com/viewtopic.php?p=14#p14
> LC-Magick #4 - Linear Perspective Image Distortion (Hermann H.)
> http://forums.livecode.com/viewtopic.php?p=148647#p148647
> LC-Magick #3 - Image Multiplexing (Hermann H.)
> http://forums.livecode.com/viewtopic.php?p=141272#p141272
> LC-Magick #2 - Pointillize (Hermann H.)
> http://forums.livecode.com/viewtopic.php?p=141051#p141051
> LC-Magick #1 - Blur and Pixelate (Scott R.)
> http://tactilemedia.com/blog/2016/03/26/update-blur-effect-plus-pixelize-bonus/

Most of it is based on ideas presented in imageMagick's documentation
http://www.imagemagick.org/Usage/


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: use-livecode Digest, Vol 163, Issue 13

2017-04-06 Thread hh via use-livecode
Richard,

these are hard words.

1) The diff is announced _loudly_ in the dict.
2) setting the paintcompression to RLE can speed up significantly in
most cases. More than 16GB of RAM and huge GPUs are not from the time
when this was introduced (when you was a young boy with curly hair).

They choose simply the faster one for the standalone. And there are not
this much cases where the diff has such a negative effect like for Peter R.

> Richard G, wrote:
> IMNSHO any differences between IDE and engine defaults should be a 
> preference option or it's a bug.
> 
> The whole point of using an xTalk is to minimize the differences between 
> runtime and development.
> 
> If the team saw fit to make PNG the default, it should be the default in 
> both environments.
> 
> If they don't feel strongly enough that it should be the default, it 
> should be a preference option.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Browser widget on linux

2017-04-13 Thread hh via use-livecode
Hi Pano,
thank you very much for coming in.

Please correct the typo in the first link.
I got "16848 is not a valid bug number" and don't know
which report you mean.

We all know you do a real good job to collect (and even
remove at once some of) and categorize the bugs in a
very complicated  structure.
Let me use this opportunity to thank you for that.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Points of Graphic Oval

2017-07-31 Thread hh via use-livecode
[Once again, without typos (although it works correctly with the typos)]

The following runs in LC 6/7/8/9.

### yields points of an 'elliptical' n0-sided polygon,
### for a 'circular' shape set rx=ry.
-- n0 is the number of vertices (= n0+1 points for a closed polygon)
-- rx is the horizontal radius
-- ry is the vertical radius
-- x0 is the horizontal coord of the shape's center
-- y0 is the vertical coord of the shape's center
function ellipticalPoints n0,rx,ry,x0,y0
  put 2*pi/n0 into cn
  -- n0 vertices --> n0+1 points as we want a closed polygon (start=end)
  -- This is here true as sin(0)=sin(2*pi) and cos(0)=cos(2*pi)
  put empty into pts
  repeat with j= 0 to n0
put CR & (round(rx*sin(j*cn)+x0),round(-ry*cos(j*cn)+y0)) after pts
  end repeat
  return char 2 to -1 of pts
end ellipticalPoints


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Points of Graphic Oval

2017-07-31 Thread hh via use-livecode
> BR wrote:
> 1) draw graphic  oval  name:  "moveClue1"
> 2) create small image "word_1"
> move image "word_1" to the points of grc "moveClue1" in 2 seconds
> OK, so how can we generate the points of a perfect oval?

> > Scott wrote:
> > You can use the effectivePoints to get the points of any graphic shape,
> > but depending on the size, your oval may produce too many points.
> > In any event, your source oval doesn't need to be perfect. If you
> > a "decent" number of points along the shape of the oval, your image
> > will have the appearance of moving along an elliptical path.

You don't need to create a graphic for that, a ("decent") list of points
is enough:

on mouseUp
  put 200 into x0
  put 200 into y0
  put 100 into rx
  put 100 into ry
  put 36 into n0 #<-- usually enough vertices for 1.5 seconds
  move image 1 to ellipticalPoints(n0,rx,ry,x0,y0) in 1500 millisecs
end mouseUp

### yields points of a elliptical n-sided polygon
### circular: set rx=ry
-- n0 is the number of vertices (= n+1 points as closed polygon)
-- rx is the horizontal radius
-- ry is the vertical radius
-- x0 is the x-coord of the center
-- y0 is the x-coord of the center
function ellipticalPoints n0,rx,ry,x0,y0
  put 2*pi/n0 into cn
  -- n0 vertices --> n0+1 points as we want a 'closed' polygon
  -- This is here true as sin(0)=sin(2*pi) and cos(0)=cos(2*pi)
  put empty into pts
  repeat with j= 0 to n0
put CR & (round(rx*sin(j*cn)+x0),round(-ry*cos(j*cn)+y0)) after pts
  end repeat
  return char 2 to -1 of of pts
end ellipticalPoints


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: HTML5: mixed signals

2017-07-28 Thread hh via use-livecode
*** The following is how I judge this, not based on any 'official document'. ***

Depends a little bit upon what you are doing. The javascript part of the calling
web page is always accessible, no matter the license. So, important parts that
you have as javascript in the standalone's webpage are protected by the license
you select for that, e.g. an MIT-license.

With an Indy version you can make it more difficult (but *not* disable) to
download the standalone.zip, i.e. avoid the download-source-link.

*** But with an HTML5 license only you can password protect the source code 
(your
scripts) of the standalone. That's the essential effect of the HTML5-license ***

For example I have one script-protected HTML5 standalone: "EasyCrop"
( = selecting by a BezierCurve tool, available on hh.on-rev.com/html5/ )
Just try to hack it ...
All others there have accessible scripts, but you have first to know how to
download the .zip that contains the source (= the "Indy-effect").

With the community version you are obliged to have a download-source-link (it's
generated at bottom right of the standalone canvas) and your scripts are *not*
password-protected.

> Matthias wrote:
> No, that means, that you have to release your source code to the public when 
> using the
> community version, while you don´t have to do it when you have a commercial 
> license.
> Richmondwrote:
> > Well, that is reasonably obvious . . . 
> > Presumably (?) that means that HTML5 things hived-off the Community version 
> > of LiveCode
> > are in readable Java-script and may be opened  and edited as such, 
> > while the version of HTML5 available for $299/year hives-off protected 
> > code? 
> > 
> > Heather wrote: 
> >> Um. Like every other platform for LiveCode, there is an open source 
> >> Community version
> >> of HTML5. Not seeing the problem here? You pay for commercial, closed 
> >> source. You use
> >> Community free and share your code. 
> >>> Richmond Mathewson wrote: 
> >>> I just recieved an e-mail from LiveCode central offering me a licence for 
> >>> HTML5 
> >>> for $299/year. 
> >>> And that seems 'normal' considering my Indy licence does NOT include a 
> >>> licence for HTML5. 
> >>> BUT: the Community version allowed me to build an HTML5 thing. 
> >>> That also seems a bit arsy-versy. 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Web vs Native (was Re: HTML5 limitations?)

2017-07-29 Thread hh via use-livecode
#wait
I don't miss the "wait" handler in HTML5 and I wouldn't miss it in LC Script.
I even don't know of any use case where "send in " (which works perfectly
in HTML5) isn't superior to "wait". Especially when connected to move/animation.

Also I don't miss "wait" in LC Builder. There OnTimer() is the superior
'substitute'.

@Jonathan
And your 'syncing' skills, demonstrated several times, show that you dont need
it. It's sometimes comfortable to write "wait 1 millisec with messages", but
nothing more, it is not an essential command.

> Jonathan wrote:
> Either I am misunderstanding, or the concept of what is difficult in Scotland
> is shedloads harder than what we puny Americans think.

Jonathan, please think about such nasty national statements. There's no need
for that.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Points of Graphic Oval

2017-07-31 Thread hh via use-livecode
> Mark wrote:
>> How do you define "strict geometry"? 
> That would be my seventh-grade math teacher 
>> And what is an "infinite amount"? 
> For points in an oval, that would be Aleph-one, no? 

I see. When you selected to return 360 points for the effective
points of an oval (what is, TMHO, a 'natural' choice) you did
indeed ask HAL, thinking of aleph1.
You couldn't accept the answer. And now Scott has to convince BR
that a "decent" number [= trunc(27*pi/2)] of points are usually
good enough for "move to " ...

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Points of Graphic Oval

2017-07-31 Thread hh via use-livecode
> Bob S. wrote:
> By strict geometry, an infinite amount. Using Bezier, 4. :-)

Just because I am curious which part of your statement is the joke:

How do you define "strict geometry"?
And what is an "infinite amount"?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: template stacks

2017-07-28 Thread hh via use-livecode
Forget to remark:

  revIDENewMainstack 40,30 = revIDENewMainstack 400,400

because

revIDENewMainstack yourWidth,yourHeight

sets new width to the maximum of yourWidth and 400
sets new height to the maximum of yourHeight and 400

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: template stacks

2017-07-28 Thread hh via use-livecode
> Richmond wrote:
> From LiveCode 8.0 upwards when one wants a new stack one is given a 
> menu of choices for iPads, iPhones and so on.
> Is there a way to edit that menu PERMANENTLY so one can accommodate
> one's own sizes?

Just type into the messageBox

  revIDENewMainstack ,

for example:

  revIDENewMainstack 400,900
  revIDENewMainstack sqrt(1600),30^2

LiveCode is so wonderful ;-)


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: template stacks

2017-07-28 Thread hh via use-livecode
Of course my "look-up" in the IDE:

  revIDENewMainstack max(,400),max(,400)

is quick and dirty compared to the clever plugin-solution of Klaus:

http://lists.runrev.com/pipermail/use-livecode/2017-July/239883.html

Sorry Klaus. I overlooked your post. I really write too much and read
too fast here. I'll better stop it now for a couple of months or so ...

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Wait, the problem, and why it is important to solve

2017-07-30 Thread hh via use-livecode
Wow. You say (using stars) it would make sense to implement wait
in HTML5 for some features that do _not_ (yet) work in HTML5.
Will be a great enhancement side-effect. I look forward to that.

Peter-B already implemented wait in 2015, see bug #16076.
This caused an _additional_ slow down by a factor of 16 that was
*overall*, i.e. also in handlers not containing any form of wait.

We had since then, not counting browser improvements, a speed up
in the HTML5 engine by a factor of up to 8. So "wait" would cause
in sum (better: in product) a slowdown by a factor of at least 2.

The slow down compared to desktop standalones of the same source
was originally 15-20. so we would arrive for that comparison at
a slowdown of 30-40 by the HTML5 engine.

This is at about the same factor as with RaspberryPiB. RaspberryPi3
has a slow down factor of at about 10.

So the move of the HTML5 engine to WebAssembly may be a necessary
condition?


> Mark wrote:
> So LiveCode has long has this feature called 'wait' - it is one of those 
> seemingly innocuous things which, from the surface seems simple (it 
> allows you to wait for something - it's great when syntax is aptly 
> named!) however it is perhaps one of the deepest language features we 
> have.
> 
> I think there is some confusion (or puzzlement) as to why I am a little 
> hung up on it because, on the whole, the 'wait' command is not actually 
> seen in script that much. Certainly it is part of some people's coding 
> style (the one thing I love about LiveCode is that it promotes a very 
> pluralistic style to solving programming problems), but on the whole 
> many of us rarely if ever use it. Well, we *think* we don't use it.
> 
> The thing is that 'wait' is such an important feature to LiveCode that 
> many pieces of syntax use it without you knowing! The pure mathematician 
> in my likes classifying and counting things (hey its what we do!), so 
> here is a reasonably complete list of the places the engine uses it 
> (this list is alphabetic by source-file in the engine order):
> 
> - it is used to provide the flash of the menu when a menu accelerator 
> key is pressed
> - it is used to wait for uses of shell() to send back any data so it 
> can be accumulated for return
> - it is used to wait for a return value from sending an AppleEvent on 
> Mac (send and request)
> - *it is used to implement 'wait for/until/while ...' (kinda obvious, 
> but hey, I was trying to be semi-complete ;))*
> - it is used to implement 'read ... with timeout' forms
> - it is used to wait for process death when you do 'kill'
> - *it is used to wait between beeps when you do 'beep '*
> - *it is used to moderate the speed of 'drag from x to y'*
> - *it is used to moderate the speed of 'type STRING '*
> - *it is used to moderate the time between mouseDown and mouseUp when 
> doing 'click at'*
> - *it is used to wait whilst a non without-waiting form of 'move' is 
> invoked*
> - it is used in the mobile browser control to wait for JavaScript 
> evaluation to finish
> - it is used to wait for mobile calendar UI modal panes to return
> - it is used to wait for mobile photo taking panes to return
> - it is used to wait for mobile contact UI modal panes to return
> - it is used to wait for mobile datetime/option picker modal panes to 
> return
> - it is used to wait for mobile compose mail UI modal panes to return
> - it is used to wait for mobile media picker UI modal panes to return
> - it is used to wait for mobile fullscreen videos to finish
> - it is used to wait for mobile text message UI modal panes to return
> - it is used to wait inbetween vibrations when you use 'iphoneVibrate 
> '
> - *it is used to wait between frames for visual effects / 
> transitions*
> - it is used in all forms of blocking socket commands (open, read, 
> write etc.)
> - it is used to wait for blocking DNS resolution to finish*
> - *it is used to wait for 'modal ' to finish (by closing the 
> stack)*
> - *it is used (in libURL) to wait for evaluation of 'url ' to 
> finish*
> - *it is used (in libURL) to wait for 'post to url ' to finish*
> - *it is used to wait for 'popup widget' to finish*
> - it is used by various other things in externals, and widgets and 
> libraries to implement things which need to wait for something or some 
> time in order to have something to return
> 
> Phew! The ones surrounded by '*' are ones which would make some sense to 
> have working in HTML5. Almost all of these can be rendered in a form 
> without 'wait', they just end up being *slightly* less useful or easy to 
> use (e.g. get url -> load url, always use 'move without waiting', etc.).
> 
> So, first thing to point out, even without 'wait', if we manage to 
> implement all the existing things which make sense in the HTML5 engine, 
> 'greenfield' (new projects) will work fine (as you avoid the things 
> which don't 

Re: CEF Browser - what is wrong with my script

2017-07-30 Thread hh via use-livecode
@Matthias
"revbrowserOpenCEF" is deprecated since at least one year or so.
Also note: revBrowserInstances() doesn't work after"revbrowserOpenCEF".

Also note if you use revBrowserOpen:
Then Mac is the only platform that supports HTML5/canvas2d.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Points of Graphic Oval

2017-08-02 Thread hh via use-livecode
I have already done what you describe in a HTML5 standalone for displaying
progress along a Bezier curve, using LC Script only.
http://hh.on-rev.com/html5/hhProgressHTML5_2-8.0.2X.html

And it is done for all LC's SVG icons using the jquery-drawsvg plugin in
a browser widget (incl. optional affine transformations of the SVG icons).
http://livecodeshare.runrev.com/stack/833/AutoDraw_SVGicon

What I meant is to have such a tricky translation of model elements
(arc, curve etc.) of an SVG path into an appropriate points-only path
in LCB? Perhaps one could use parts of LC-Ian's SVG work for that?

> Mark wrote:
> Heh - sometimes it takes a relative tome of justification to arrive at a
> simple explanation!
> 
> However the beauty of Bézier curves is that arcs are just a small subset
> of what they can represent 'well enough'.
> 
> For moving along an arbitrary (Bézier - you can represent a straight line
> segment as one trivially) path, what you actually need is first the length
> of the path (annoyingly not a representable function - iirc) and a parametric
> form of a Bézier curve (which is how they are best expressed).
> 
> Then to step along the path at fixed distance at each step you use
> f(n * fixeddist / length) (here f is the parametric form of the Bézier
> - returning a 2d point). You'd need some adjustment (+/- 1 pix) to account
> for rounding error - but I think the idea is sound.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Points of Graphic Oval

2017-08-02 Thread hh via use-livecode
> Mark wrote:
> So, at the level of the graphic object it is a true arc, at the level of 
> instructing
> the graphics library it is a Bézier approximation but at the level of working 
> out what
> pixels to render it is a polygon.

Thanks for arriving from your previous post at this very clear statement.
You will have to do a lot of such approximations by simple polygons when you 
implement
to move along an SVG path for your SVG widget... ;-)

p.s. The 360 points of Mark are really good enough for very large circles in 
order to
move along such points in 2 seconds. These are 3 points per tick!
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Points of Graphic Oval

2017-08-02 Thread hh via use-livecode
The effective points of an oval (circle) are the 360 points of a regular
polygon with 360 vertices (if it's closed). You could look at stack #2 of
the Raspi-Collection, runs on Mac/Win/linux using LC 6/7/8/9:

http://forums.livecode.com/viewtopic.php?p=98716#p98716
(in LC 8/9 add a semicolon after "origin" in line 66 of the card script).

Change there the number of vertices N to 24,32,64 or 360 and you will
understand, why Scott said, a "decent" number is enough.

A circle is, just like a Bezier curve, a mathematical model, for thinking,
doing mathematics. Not realizable in our virtual world.
What you can have and what you see are (more or less good) approximations
to that model, here nothing more than simple polygons.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: MouseDown sent to button in group, but MouseUp sent to card

2017-08-03 Thread hh via use-livecode
> Monte wrote:
> ... G drinking holiday ;-)

Practising Geometry & Trigonometry and drinking??

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Simplify polygon

2017-08-15 Thread hh via use-livecode
Today I implemented the Ramer-Douglas-Peucker algorithm for reducing the
number of points of a polygon such that the "shape" of that polygon is
preserved as good as possible, controlled by a tolerance parameter.
This is known as "simplifying" of a polygon (is also done for polygon/
polyline paths in SVG, could be done in LC Builder).

The algorithm is fast and very effective. May be interesting for some of
you who work with map outlines ("coastlines") or auto traced outlines of
images/graphics, signatures or freehand-drawings:

http://forums.livecode.com/viewtopic.php?p=157049#p157049
(=Raspi stacks collection #103)


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Couple of questions about the browser widget

2017-08-16 Thread hh via use-livecode
Additional to Jonathan's instructions.

Basic:
http://forums.livecode.com/viewtopic.php?f=7=29589

Medium: Get MouseEvents from browser widget
http://forums.livecode.com/viewtopic.php?p=154496#p154496

and others there (7 Browser Widget usage examples) ...

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Forum: Waves of Russian Nonsense

2017-08-15 Thread hh via use-livecode
>> Mark wrote:
>> This is getting annoying.

> Klaus wrote:
> I just deleted 71 slavic spam postings from the forum manually again,
> now THAT is getting annoying!

+71 for you. Thanks for that.

But better stop manual deletion now. As long as you do that probably nothing
will improve/change. It would be an action of 2 minutes to enable you and some
others (Richard) to do that in a few seconds.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: lockscreen?

2017-08-15 Thread hh via use-livecode

> Richmond wrote:
> If I lock the screen (so these automations don't show up) will that
> speed things up?

lock screen; lock messages

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: JPNG

2017-08-11 Thread hh via use-livecode
@Mark

*** Thanks for your expertise. I couldn't do that this perfectly. ***

One of the reasons for posting this JPNG stack is to show the power of LC:
The essential code of compressing PNG -> JPNG and decompresing PNG -> JPNG
is both less than 10 *essential* lines of code, using comfortable LC tools.

It is currently "en vogue" to try using JPEG compression together with
transparency. The js- and/or objC-people have to do _a lot more_ for that.

So take my demo stack as 'suggestion for the engine', to add a JPNG format
to LiveCode with a compression parameter and an useAlphaDataOrMaskData switch.
[ Possibly also with adding JPEG 2000 (.jp2)? ]
The work is nearly done as it is already available in the engine to a big part.
And for the dictionary entry use your post ;-)

This all could contribute to make the size of standalones that contain a lot
of PNG-compressed images significantly smaller. An may also be of advantage
for a usage together with the browser widget.
Once again, with a JPEGquality of 80 I have here in average JPNG-compressed
sizes of 30% compared to the original PNG-compressed sizes.

[I'll update the JPNG stack today for use on RaspberryPi 2/3 (and in LC 6/7).]


Mark wrote:
> On 2017-08-11 09:29, Richmond Mathewson via use-livecode wrote:
> > In theory that sounds both impressive and useful . . .
> > 
> > But, what, apart from your stack can read the format/compression
> > method properly.
> 
> I think Hermann's suggestion is a bespoke way of reducing resource size 
> for built apps and their content - as there isn't a 'standard' for JPNG 
> (yet) it isn't really useful for interchange between apps, but it might 
> be that a standard does appear at some point.
> 
> > Can your stack export a JPNG image?
> 
> It doesn't need to in order to be useful. This is something which could 
> be used at the point of building a standalone (in a standaloneSaving 
> handler, for example) to convert PNG images into a smaller form for use 
> by the app at runtime.
> 
> > "This may even result in a larger data size than the original when
> > decompressing."
> 
> I'm not sure I quite understand that comment...
> 
> Any (loss-less) compression algorithm will produce output which is 
> larger than the input for some inputs 
> (https://en.wikipedia.org/wiki/Lossless_compression#Limitations). So all 
> (such) compression algorithms tend to have a flag in their encoded 
> output which says 'this is not compressed'. When the compressor runs, if 
> the output is greater in size than the original input it just emits the 
> output with that flag and the original data. (In this case, if the JPNG 
> process produces a data size larger than the original PNG, just use the 
> original PNG!).
> 
> In this case the JPNG idea exploits the fact that color images tend to 
> withstand data-loss, but alpha data (masks) do not - JPEG is lossy, it 
> removes information which our eyes cannot see. PNG compression (a 
> variant of gzip IIRC) is loss-less, it preserves the exact values of the 
> inputs. So you use the lossy method (JPEG) on the part of the image 
> which makes no difference to our eyes, and the loss-less method (PNG) on 
> the part of the image which our eyes would notice a difference in.
> 
> Warmest Regards,
> 
> Mark.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


JPNG

2017-08-10 Thread hh via use-livecode
JPNG (named using JPEG and PNG) is not an image format but a compression method.
We use the file ending ".lcjpng" for that.

It takes features from both JPEG (setting JPEGquality to compress the imageData
and from the PNG compression the alphaData/transparency). It saves the 
alphaData,
optionally the maskData, and the JPEG-compressed imageData in one file. The
JPNG-compressed image has here, using a JPEGquality of 80, around 25% of the
PNG-compressed size.

So this may be interesting for people who wish to compress (significantly in
size) the PNG-images containing transparency in their stack/standalone and
decompress only some images for "current" use.

Compression/Decompression is very fast. 

See stack "JPNG" via the "Sample stacks" of the LC toolbar or (slower) here:
http://livecodeshare.runrev.com/stack/841/JPNG
This sample stack compresses to files or to (numbered) custom properties.

Note: I don't use the JPNG data structure of js or objC, but you can easily
convert it to that.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Problem showing card script in IDE in LC9.0.0(dp7)

2017-07-07 Thread hh via use-livecode
http://quality.livecode.com/show_bug.cgi?id=19887

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: intersect . . . invisible images

2017-07-17 Thread hh via use-livecode
> Richmond M. wrote:
> That's because Richmond doesn't share your sense of humour,
> and never really could understand North American jokes . . .

As I read this thread (as a non-native speaker), none of the jokes
was against you as person. And mine was based on a very old forum
thread connected to a sock in the sense of the irish "seven drunken
nights".

Some of the misunderstanding may be due to the fact that you, being
a linguist, are deeper in the meaning of some wording and phrasing
than others.

At any rate: Sorry from me.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


  1   2   3   4   5   6   7   8   9   >