Joe, Fred, Dale, all -

Sorry for jumping in, but I saw your thread about resizing the AB
window for output to PNG for possible inclusion on a page or in a doc.  
Significant image scaling in an image program or browser introduces
artifacts.  Sounds like what you want to do is control the export
image size.  For script programmers, there is a utility that allows
window resizing (and much more) called AutoIt.  I'll show a quick AB
example.

AutoIt is a scripting language, but many functions are implemented in
an ActiveX DLL that is callable from script outside or inside of AB. 
First you install the package, or just the component, AutoItX3.dll via
REGSVR32.  You can get it at -

http://www.autoitscript.com/autoit3/

Then, here's an example AFL script that resizes the main
AB window.

There is an issue, though.  First, the image size is obviously less
than the window size.  For example, in a 800x600 window with left
hidden workspace, toolbar at top and right, and a status bar at the
bottom - the PNG image size is 743x505. It would desirable to be able
to be able to control this directly.  One can come close
with AutoIt, though.

Anyway, here's the AFL/Script code that uses the AutoItX3 DLL -


EnableScript("vbscript");

<%

Set oAB         = CreateObject( "Broker.Application" )
Set oAutoIt     = CreateObject( "AutoItX3.Control" )

ABTitle         = "AmiBroker"

xpos                    = oAutoIt.WinGetPosX( ABTitle )
ypos                    = oAutoIt.WinGetPosY( ABTitle )
width                   = oAutoIt.WinGetPosWidth( ABTitle )
Height          = oAutoIt.WinGetPosHeight( ABTitle )

newwidth                = 800
newheight               = 600
oAutoIt.WinMove "AmiBroker", "", xpos, ypos, newwidth, newheight 

oAB.RefreshAll()

%>

Buy                     = Sell = Short = Cover = 0;





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to