Re: Export & LC8 & Browser widget

2016-03-02 Thread Trevor DeVore
On Wed, Mar 2, 2016 at 9:11 AM, Mark Waddingham  wrote:

> Take a look at the "do in widget" command in the dictionary.


This just made my day. Here I was thinking there was no two-way
communication.

-- 
Trevor DeVore
ScreenSteps
www.screensteps.com-www.clarify-it.com
___
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: Export & LC8 & Browser widget

2016-03-02 Thread Mark Waddingham

On 2016-03-02 15:18, Terence Heaford wrote:

Thanks, for some reason I thought it would be in the widget docs.


Indeed that would be a logical place for it to be - the reason it isn't 
is because the browser widget syntax (such as 'do ...') is currently 
hard-coded in the engine's parser rather than defined by the widget (the 
latter will come when we've finished Open Language) and so the 
dictionary doesn't actually know that there is specific syntax for the 
browser widget.


I've raised Bug 17053 about that 
(http://quality.livecode.com/show_bug.cgi?id=17053).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: Export & LC8 & Browser widget

2016-03-02 Thread Terence Heaford
Thanks, for some reason I thought it would be in the widget docs.


All the best

Terry


> On 2 Mar 2016, at 14:11, Mark Waddingham  wrote:
> 
> Take a look at the "do in widget" command in the dictionary.
> 
> 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


Re: Export & LC8 & Browser widget

2016-03-02 Thread Mark Waddingham

On 2016-03-02 15:09, Terence Heaford wrote:

This seems to be the best way by calling from LiveCode into the
Javascript of the Browser.

I have found this which seems to allow for calling LiveCode from
Javascript but not anything going in the other direction?

--
Name: javascriptHandlers
Type: property
Syntax: set the javascriptHandlers of  to 
get the javascriptHandlers of 
Summary: A list of LiveCode handlers that are made available to
JavaScript calls within the browser.
———


Take a look at the "do in widget" command in the dictionary.

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: Export & LC8 & Browser widget

2016-03-02 Thread Terence Heaford

> On 2 Mar 2016, at 13:53, Mark Waddingham  wrote:
> 
> If you are printing the browser content on its own, then you could try using 
> JavaScript - something along the lines of 'window.print()'. However, I'm not 
> sure how controllable that is - perhaps someone with more intimate knowledge 
> of doing such things in JavaScript in browsers could chime in and comment :)


This seems to be the best way by calling from LiveCode into the Javascript of 
the Browser.

I have found this which seems to allow for calling LiveCode from Javascript but 
not anything going in the other direction?

--
Name: javascriptHandlers
Type: property
Syntax: set the javascriptHandlers of  to 
get the javascriptHandlers of 
Summary: A list of LiveCode handlers that are made available to JavaScript 
calls within the browser.
———


All the best

Terry
___
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: Export & LC8 & Browser widget

2016-03-02 Thread Mark Waddingham

On 2016-03-02 14:26, Terence Heaford wrote:

Thanks for the comments.

As I am using a Browser to display amCharts it would be good to be
able to print the contents of the Browser.

This workaround of snapshot gives a poor printout when it is copied to
an image for printing.

Would there be a better way to achieve this?

I understand the need to create widgets to showcase what can be
achieved with LC8 but I am thinking it is counter productive
to include widgets that are not completed, particularly when LC8 is 
released.


The Browser is a good example in that without printing functionality,
it’s not useless but is severely limited.


For a use-case which requires printing the browser contents then yes, 
that is a limitation. However, it would be a huge stretch to assert that 
'all uses of a browser require printing functionality' because they 
don't, quite frankly. So, 'severely limited' - no; not ideal for your 
use-case - yes.


To be fair, if you are trying to print the current image in the browser 
window as part of a larger document rather than just the browser window 
contents itself then I'm not sure that is actually going to be generally 
possible. I *think* it can be done on Mac (as the WebView component has 
the standard Cocoa-based printing ability at first sight at least), 
however I'm not so sure on the other platforms - particularly mobile. (I 
just had a quick look into CEF and the options there do appear to be 
very very limited as well).


If you are printing the browser content on its own, then you could try 
using JavaScript - something along the lines of 'window.print()'. 
However, I'm not sure how controllable that is - perhaps someone with 
more intimate knowledge of doing such things in JavaScript in browsers 
could chime in and comment :)


Looking into amCharts there does seem to be a way to 'export' a chart as 
an image using JS - either as images or SVG. You could export as a PNG / 
JPG at 2-4x the size in pixels and then print that using LiveCode - that 
would give a better fidelity result. Once we have SVG support integrated 
(which won't happen for LC8 unfortunately, but should shortly 
afterwards), then that would be another approach which will give much 
better fidelity.


Alternatively, you could consider generating a PDF from JavaScript 
(there's a tutorial of that on the amCharts site), or building a web 
page with all that you wish to print and using the 'window.print()' 
method - taking LiveCode out of the equation entirely.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: Export & LC8 & Browser widget

2016-03-02 Thread Terence Heaford
Thanks for the comments.

As I am using a Browser to display amCharts it would be good to be able to 
print the contents of the Browser.

This workaround of snapshot gives a poor printout when it is copied to an image 
for printing.

Would there be a better way to achieve this?

I understand the need to create widgets to showcase what can be achieved with 
LC8 but I am thinking it is counter productive
to include widgets that are not completed, particularly when LC8 is released.

The Browser is a good example in that without printing functionality, it’s not 
useless but is severely limited.


All the best

Terry

> On 2 Mar 2016, at 08:34, Mark Waddingham  wrote:
> 
> On 2016-03-02 08:36, Terence Heaford wrote:
>> This suggestion doesn’t work because the widget is a Browser widget
>> and I believe the browser is not a true object
>> but a window overlay.
> 
> Not exactly - the browser widget is a true engine object, but it uses a 
> 'native' layer to display itself. At present native layers do stack above the 
> card layer (which also renders into a native layer, just with drawing code 
> the engine has complete control over) but we would like to make them 
> interleave as you would generally expect at some point (there's just a fair 
> bit of engineering to do to get that to work!). (Note that there is a well 
> defined ordering for layers used by native layer using objects - the layering 
> follows the same layering as the objects on the card, its just that all 
> non-native objects will stack first, then all native objects).
> 
> Whether or not you can actually get the pixels directly out of a native layer 
> depends entirely on what 'kind' the native layer is and whether the platform 
> lets you do that kind of thing.
> 
> See my other post for more details.
> 
> Warmest Regards,
> 
> Mark.
> 
> -- 
> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
> 
> ___
> 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


___
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: Export & LC8 & Browser widget

2016-03-02 Thread Mark Waddingham

On 2016-03-02 08:36, Terence Heaford wrote:

This suggestion doesn’t work because the widget is a Browser widget
and I believe the browser is not a true object
but a window overlay.


Not exactly - the browser widget is a true engine object, but it uses a 
'native' layer to display itself. At present native layers do stack 
above the card layer (which also renders into a native layer, just with 
drawing code the engine has complete control over) but we would like to 
make them interleave as you would generally expect at some point 
(there's just a fair bit of engineering to do to get that to work!). 
(Note that there is a well defined ordering for layers used by native 
layer using objects - the layering follows the same layering as the 
objects on the card, its just that all non-native objects will stack 
first, then all native objects).


Whether or not you can actually get the pixels directly out of a native 
layer depends entirely on what 'kind' the native layer is and whether 
the platform lets you do that kind of thing.


See my other post for more details.

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: Export & LC8 & Browser widget

2016-03-02 Thread Mark Waddingham

On 2016-03-01 22:57, Terence Heaford wrote:
On 1 Mar 2016, at 21:32, J. Landman Gay  
wrote:


"To export a snapshot for a portion of a stack you use the form:
export snapshot from rect[angle] of window windowID to ...
Where windowId is the windowId property of the required stack."


This does not work correctly on a Mac for the reason given previously.

The top and bottom of the image exported has shifted down by the depth
of the menubar.
put the rect widget "Chart" into tRect

export snapshot from rectangle tRect of window (the windowId of window
"Test") to tVar as PNG


The corrected version would be:

put the rect widget "Chart" into tRect

subtract 22 from item 2 of tRect

subtract 22 from item 4 of tRect

export snapshot from rectangle tRect of window (the windowId of window
 “Test") to tVar as PNG


There are three types of export/import snapshot.

The first uses the screen buffer - the co-ordinates have to be in screen 
co-ordinate space:


  export snapshot from rectangle tRect

The second uses the window buffer (if the OS has such things, otherwise 
it is equivalent to using the screen buffer after a translation of 
co-ordinates) - the co-ordinates have to be in window co-ordinate space 
(NOT card co-ordinate space):


  export snapshot from rectangle tRect of window tWindowId

The third uses no buffer at all, it asks the target object (and 
children) to render the specified rect of itself into an offscreen 
buffer (the same mechanism which the engine uses to update a window when 
the OS requests it, or a portion gets changed) - the co-ordinates have 
to be in card co-ordinate space:


  export snapshot from rectangle tRect of 

Now, the final form here will work for any object which is drawn by the 
LiveCode engine - it will not necessarily work for objects which use 
'native' layers to display things (such as the browser). Whether or not 
one can get a native layer to render itself entirely depends on the 
native layer. For example, we've not had any success at all in 
persuading the CEF browser to give us a snapshot as it uses various 
'native' things which do not want to give up their backing store of 
pixels.


Therefore, if you want to take a snapshot of a stack containing native 
layers your best bet to make this work generally is to use the screen or 
window form. When you do this you do have to take into account the fact 
that cards might have a vertical scroll due to menus (that mysterious 22 
px) - you can get the current scroll amount by using 'the vscroll of 
stack ...'.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: Export & LC8 & Browser widget

2016-03-01 Thread Terence Heaford

> On 1 Mar 2016, at 23:29, Richard Gaskin  wrote:
> 
> Ever since the option was added to take a screen shot directly from an 
> object's rendered buffer I've been using that, since I get high-quality 
> results and can also work with objects not currently on screen.
> 
> Does this not work with widgets?:
> 
>  export snapshot from widget "Chart" to tVar as PNG


This does not work because a Browser widget is not a true LiveCode object.

The same problem as Ali Lloyd’s suggestion.


All the best

Terry



___
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: Export & LC8 & Browser widget

2016-03-01 Thread Terence Heaford

> On 1 Mar 2016, at 23:11, Ali Lloyd  wrote:
> 
> I find I get the best results from export snapshot by using the following
> form:
> 
> export snapshot from rect (the rect of tObjectLongID) of tObjectLongID ...
> 
> So you might try
> 
> export snapshot from rect (the rect of widget "Chart") of widget "Chart" of
> this card to tVar as PNG
> 
> If that doesn't give you the correct image then there's definitely a bug
> somewhere.


This suggestion doesn’t work because the widget is a Browser widget and I 
believe the browser is not a true object
but a window overlay.


All the best


Terry
___
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: Export & LC8 & Browser widget

2016-03-01 Thread Richard Gaskin

Ali Lloyd wrote:

> I find I get the best results from export snapshot by using the
> following form:
>
> export snapshot from rect (the rect of tObjectLongID) of 
tObjectLongID ...

>
> So you might try
>
> export snapshot from rect (the rect of widget "Chart") of widget 
"Chart" of

> this card to tVar as PNG
>
> If that doesn't give you the correct image then there's definitely
> a bug somewhere.

Ever since the option was added to take a screen shot directly from an 
object's rendered buffer I've been using that, since I get high-quality 
results and can also work with objects not currently on screen.


Does this not work with widgets?:

  export snapshot from widget "Chart" to tVar as PNG


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com


___
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: Export & LC8 & Browser widget

2016-03-01 Thread Ali Lloyd
I find I get the best results from export snapshot by using the following
form:

export snapshot from rect (the rect of tObjectLongID) of tObjectLongID ...

So you might try

export snapshot from rect (the rect of widget "Chart") of widget "Chart" of
this card to tVar as PNG

If that doesn't give you the correct image then there's definitely a bug
somewhere.

On Tue, Mar 1, 2016 at 10:39 PM Richard Gaskin 
wrote:

> Terence Heaford wrote:
>
> >> On 1 Mar 2016, at 21:57, Terence Heaford 
> wrote:
> >>
> >> put the rect widget "Chart" into tRect
> >>
> >> subtract 22 from item 2 of tRect
> >>
> >> subtract 22 from item 4 of tRect
> >
> > As a Mac only person I really find it weird to keep having to make
> adjustments for the height of a menu.
>
> I dream of a day when I can enjoy that minor weirdness to support
> Ubuntu's global menu bar:
>
> http://quality.livecode.com/show_bug.cgi?id=10026
>
> --
>   Richard Gaskin
>   Fourth World Systems
>   Software Design and Development for the Desktop, Mobile, and the Web
>   
>   ambassa...@fourthworld.comhttp://www.FourthWorld.com
>
> ___
> 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
>
___
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: Export & LC8 & Browser widget

2016-03-01 Thread Richard Gaskin

Terence Heaford wrote:


On 1 Mar 2016, at 21:57, Terence Heaford  wrote:

put the rect widget "Chart" into tRect

subtract 22 from item 2 of tRect

subtract 22 from item 4 of tRect


As a Mac only person I really find it weird to keep having to make adjustments 
for the height of a menu.


I dream of a day when I can enjoy that minor weirdness to support 
Ubuntu's global menu bar:


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

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
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: Export & LC8 & Browser widget

2016-03-01 Thread J. Landman Gay
Oh! I understand now. That might be a bug, depending on how you look at 
it. Card coordinates don't change when there's a menu scrolled out of 
view; you'd think that snapshots wouldn't either.


On 3/1/2016 4:24 PM, Tore Nilsen wrote:

I think Terence has a menuBar of his own making in the stack, that would count 
for the extra 22 pixels on the card being pushed upward on the mac version, but 
still a part of the card height.

Tore



1. mar. 2016 kl. 23.22 skrev J. Landman Gay :

On 3/1/2016 3:57 PM, Terence Heaford wrote:



On 1 Mar 2016, at 21:32, J. Landman Gay 
wrote:

"To export a snapshot for a portion of a stack you use the form:
export snapshot from rect[angle] of window windowID to ... Where
windowId is the windowId property of the required stack."


This does not work correctly on a Mac for the reason given
previously.

The top and bottom of the image exported has shifted down by the
depth of the menubar. put the rect widget "Chart" into tRect

export snapshot from rectangle tRect of window (the windowId of
window "Test") to tVar as PNG


It works here on a Mac. I happened to have a tree view widget at hand, but any 
of them should work.

put the windowid of this stack into twid
export snapshot from rect (the rect of widget "tree view") \
   of window twid to file "imgTest.png" as PNG

No adjustments needed.



--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
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: Export & LC8 & Browser widget

2016-03-01 Thread J. Landman Gay

On 3/1/2016 3:57 PM, Terence Heaford wrote:

put the rect widget "Chart" into tRect


That may be the problem.

put the rect *OF* widget "chart"...

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
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: Export & LC8 & Browser widget

2016-03-01 Thread Tore Nilsen
I think Terence has a menuBar of his own making in the stack, that would count 
for the extra 22 pixels on the card being pushed upward on the mac version, but 
still a part of the card height.

Tore


> 1. mar. 2016 kl. 23.22 skrev J. Landman Gay :
> 
> On 3/1/2016 3:57 PM, Terence Heaford wrote:
>> 
>>> On 1 Mar 2016, at 21:32, J. Landman Gay 
>>> wrote:
>>> 
>>> "To export a snapshot for a portion of a stack you use the form:
>>> export snapshot from rect[angle] of window windowID to ... Where
>>> windowId is the windowId property of the required stack."
>> 
>> This does not work correctly on a Mac for the reason given
>> previously.
>> 
>> The top and bottom of the image exported has shifted down by the
>> depth of the menubar. put the rect widget "Chart" into tRect
>> 
>> export snapshot from rectangle tRect of window (the windowId of
>> window "Test") to tVar as PNG
> 
> It works here on a Mac. I happened to have a tree view widget at hand, but 
> any of them should work.
> 
> put the windowid of this stack into twid
> export snapshot from rect (the rect of widget "tree view") \
>   of window twid to file "imgTest.png" as PNG
> 
> No adjustments needed.
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com 
> 
> HyperActive Software   | http://www.hyperactivesw.com 
> 
> 
> ___
> 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 
> 
___
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: Export & LC8 & Browser widget

2016-03-01 Thread J. Landman Gay

On 3/1/2016 3:57 PM, Terence Heaford wrote:



On 1 Mar 2016, at 21:32, J. Landman Gay 
wrote:

"To export a snapshot for a portion of a stack you use the form:
export snapshot from rect[angle] of window windowID to ... Where
windowId is the windowId property of the required stack."


This does not work correctly on a Mac for the reason given
previously.

The top and bottom of the image exported has shifted down by the
depth of the menubar. put the rect widget "Chart" into tRect

export snapshot from rectangle tRect of window (the windowId of
window "Test") to tVar as PNG


It works here on a Mac. I happened to have a tree view widget at hand, 
but any of them should work.


put the windowid of this stack into twid
export snapshot from rect (the rect of widget "tree view") \
   of window twid to file "imgTest.png" as PNG

No adjustments needed.
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
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: Export & LC8 & Browser widget

2016-03-01 Thread Terence Heaford

> On 1 Mar 2016, at 21:57, Terence Heaford  wrote:
> 
> put the rect widget "Chart" into tRect
> 
> subtract 22 from item 2 of tRect
> 
> subtract 22 from item 4 of tRect


As a Mac only person I really find it weird to keep having to make adjustments 
for the height of a menu.

All the best

Terry
___
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: Export & LC8 & Browser widget

2016-03-01 Thread Terence Heaford

> On 1 Mar 2016, at 21:32, J. Landman Gay  wrote:
> 
> "To export a snapshot for a portion of a stack you use the form:
> export snapshot from rect[angle] of window windowID to ...
> Where windowId is the windowId property of the required stack."

This does not work correctly on a Mac for the reason given previously.

The top and bottom of the image exported has shifted down by the depth of the 
menubar.
put the rect widget "Chart" into tRect

export snapshot from rectangle tRect of window (the windowId of window "Test") 
to tVar as PNG


The corrected version would be:

put the rect widget "Chart" into tRect

subtract 22 from item 2 of tRect

subtract 22 from item 4 of tRect

export snapshot from rectangle tRect of window (the windowId of window  “Test") 
to tVar as PNG



All the best

Terry
___
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: Export & LC8 & Browser widget

2016-03-01 Thread J. Landman Gay

On 3/1/2016 1:41 PM, Terence Heaford wrote:

I have been unable to get the Browser widget to print as I
suspect there is no option for this so I thought I would try a snapshot using 
this:

export snapshot from rect (the rect of widget "Chart") of this card to tVar as 
PNG

put tVar into image "myImage"


Unfortunately it does not capture the image in the correct rect of the card 
even though the dimensions seem correct.

Am I missing something in the application of the export snapshot command.


The coordinates are global to the screen unless you specify a window ID. 
I.e., 0,0 is the top left corner of the monitor.


You can either translate the coords to global using globalLoc() or 
specify a window ID. From the docs:


"To export a snapshot for a portion of a stack you use the form:
export snapshot from rect[angle] of window windowID to ...
Where windowId is the windowId property of the required stack."

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
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: Export & LC8 & Browser widget

2016-03-01 Thread Terence Heaford

> On 1 Mar 2016, at 20:33, Tore Nilsen  wrote:
> 
> It may not be the most elegant solution, but this works for me:
> 
> on mouseUp
> 
> put the rect widget "Chart" into tRect
> 
> add left of this stack to item 1 of tRect
> 
> add left of this stack to item 3 of tRect
> 
> add top of this stack to item 2 of tRect
> 
> add top of this stack to item 4 of tRect
> 
> export snapshot from rect tRect to tVar as PNG
> 
> put tVar into image "myImage"
> 
> end mouseUp
> 
> 
> Tore


This didn’t quite work correctly on my iMac there is a grey bar at the bottom 
of the image.

I believe this is do with the height of the menubar?

add left of this stack to item 1 of tRect

add left of this stack to item 3 of tRect

add top of this stack - 22 to item 2 of tRect

add top of this stack - 22 to item 4 of tRect


Thanks

Terry
___
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: Export & LC8 & Browser widget

2016-03-01 Thread Tore Nilsen
It may not be the most elegant solution, but this works for me:

on mouseUp

put the rect widget "Chart" into tRect

add left of this stack to item 1 of tRect

add left of this stack to item 3 of tRect

add top of this stack to item 2 of tRect

add top of this stack to item 4 of tRect

export snapshot from rect tRect to tVar as PNG

put tVar into image "myImage"

end mouseUp


Tore
> 1. mar. 2016 kl. 20.57 skrev Tore Nilsen :
> 
> You must take the distance from the left egde of the screen and from the top 
> of the screen into consideration when you try to export a snapshot of a 
> browser instance. The browsers position is measured from the topLeft of the 
> screen, not the card I think.
> 
> Tore
>> 1. mar. 2016 kl. 20.41 skrev Terence Heaford :
>> 
>> I have been unable to get the Browser widget to print as I
>> suspect there is no option for this so I thought I would try a snapshot 
>> using this:
>> 
>> export snapshot from rect (the rect of widget "Chart") of this card to tVar 
>> as PNG
>> 
>> put tVar into image "myImage"
>> 
>> 
>> Unfortunately it does not capture the image in the correct rect of the card 
>> even though the dimensions seem correct.
>> 
>> Am I missing something in the application of the export snapshot command.
>> 
>> 
>> Thanks
>> 
>> Terry
>> ___
>> 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
> 
> 
> ___
> 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

___
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: Export & LC8 & Browser widget

2016-03-01 Thread Tore Nilsen
You must take the distance from the left egde of the screen and from the top of 
the screen into consideration when you try to export a snapshot of a browser 
instance. The browsers position is measured from the topLeft of the screen, not 
the card I think.

Tore
> 1. mar. 2016 kl. 20.41 skrev Terence Heaford :
> 
> I have been unable to get the Browser widget to print as I
> suspect there is no option for this so I thought I would try a snapshot using 
> this:
> 
> export snapshot from rect (the rect of widget "Chart") of this card to tVar 
> as PNG
> 
> put tVar into image "myImage"
> 
> 
> Unfortunately it does not capture the image in the correct rect of the card 
> even though the dimensions seem correct.
> 
> Am I missing something in the application of the export snapshot command.
> 
> 
> Thanks
> 
> Terry
> ___
> 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


___
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