Hello,

The AFL formula itself is OK and does not create any problems.
The crash you are getting is because of possible corruption of broker.newcharts 
file
and/or layout you are using.

You may try the following: CLOSE that particular pane, then
insert the very same formula into NEW chart pane. Should work fine then.

Best regards,
Tomasz Janeczko
amibroker.com

On 2010-08-23 15:19, Progster wrote:
>    TJ,
>
> Thanks for your further comments. It all seems very logical (except for
> the part about what I'm observing here!).
>
> FWIW, here is a link to a short video showing the Edit->Image->Export
> producing the "black-screen" for a rather simple AFL:
>
> http://www.screencast.com/t/YzY0MmNiMjQt
>
> I can also note that if I don't comment out the line:
>
> SetChartBkColor( Chart_BG ) ;
>
> then the program will crash. I sent in that crash report a few minutes ago.
>
> At this point, it seems more like a support issue, so I'll send any more
> tweaky details to support. However, if some program that I have
> installed, or some MS update, or something else that would apply to
> others than myself is implicated, then that would be relevant to readers
> who might be in the same situation. In that case I'll follow up here.
>
> - Progster
>
>
> On 8/23/2010 7:56 AM, Tomasz Janeczko wrote:
>> Hello,
>>
>> What the Edit->Image->Export code does is to:
>> a) create screen-compatible in-memory bitmap
>> b) "paint" the window into the bitmap (the difference being that
>> "destination" is not screen but in-RAM bitmap created in a)
>> c) store to a file
>>
>> So essentially you should get WYSIWYG behavior. The picture you are
>> getting should be the same as you see on screen.
>> "This is a blank chart" is only shown when there is no chart formula
>> attached to given window. But in that case you would
>> see the same on-screen.
>> The only thing that can theoretically affect normal operation is
>> changing current working directory within some formula(s),
>> so relative paths to formulas are no longer valid.
>>
>> Best regards,
>> Tomasz Janeczko
>> amibroker.com
>>
>> On 2010-08-23 13:26, progster01 wrote:
>>> Tomasz,
>>>
>>> Thank you for your further comments. I had not been using
>> Edit->Image->Export in my tests, and that is indeed a helpful pathway.
>>> I have been using the ExportImage OLE call from outside of AmiBroker
>> (external .js file) as you describe. That also is surely a good reminder!
>>> I do now have some new information (directly from using
>> Edit->Image->Export ) -
>>> The issue is layout-dependent (or pane- or AFL- dependent).
>>>
>>> Trying Edit->Image->Export on different layouts, some of them export
>> a picture fine, and some of them export the black 'This is a blank
>> chart' display.
>>> Can you think of anything about a layout, pane, or AFL which might
>> cause this?
>>> - Progster
>>>
>>>
>>> --- In [email protected]
>> <mailto:amibroker%40yahoogroups.com>, Tomasz Janeczko<gro...@...>  wrote:
>>>> Hello,
>>>>
>>>> You should try Edit->Image->Export to image,
>>>> if that works, OLE should work as well as both share the same code.
>>>>
>>>> Make sure also to use ExportImage OLE call from OUTSIDE of
>> AmiBroker (external .js file).
>>>> If you attempt to do ExportImage from within indicator code
>>>> that is currently running, it would create implict loop
>>>> (export image->refresh->afl execution->export image->refresh->afl
>> execution)
>>>> and AmiBroker is protected against such deadlock/infinite loop
>> situation.
>>>> Best regards,
>>>> Tomasz Janeczko
>>>> amibroker.com
>>>>
>>>> On 2010-08-23 00:23, Progster wrote:
>>>>> I wonder if there is any chance that the presence of SnagIt could be
>>>>> interfering with ExportImage?
>>>>>
>>>>> (I have SnagIt on all the machines ...)
>>>>>
>>>>> On 8/22/2010 4:51 PM, Progster wrote:
>>>>>> OK, thanks for that. I must have some sort of local configuration
>>>>>> incompatibility ...
>>>>>>
>>>>>> If anyone else should see the same problems as I've seen, please
>> drop a
>>>>>> note, and if I solve it, I'll report back.
>>>>>>
>>>>>>
>>>>>> On 8/21/2010 3:51 PM, amibroker wrote:
>>>>>>> Hello,
>>>>>>>
>>>>>>> Yes, the script works perfectly fine on my end and produces
>> correct image.
>>>>>>> Best regards,
>>>>>>> Tomasz Janeczko
>>>>>>> amibroker.com
>>>>>>>
>>>>>>> --- In [email protected]
>> <mailto:amibroker%40yahoogroups.com><mailto:amibroker%40yahoogroups.com>,
>>>>>>> "progster01"<progster@>  wrote:
>>>>>>>> Thanks for the suggestion, but the DISPLAY (Windows Control Panel)
>>>>>>> was already set to 32-bits.
>>>>>>>> Does either of the provided scripts work for you and produce a
>>>>>>> picture other than the blank-screen message?
>>>>>>>> --- In [email protected]
>> <mailto:amibroker%40yahoogroups.com>
>>>>>>> <mailto:amibroker%40yahoogroups.com>, "amibroker"<groups@>  wrote:
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>> ExportImage works perfectly fine. The only thing you should do
>> is to
>>>>>>>>> set your DISPLAY (Windows Control Panel) TO 24-bits or 32-bits
>>>>>>> (TRUE COLOR). You need true color display to be able to export
>> 24-bit
>>>>>>> PNGs.
>>>>>>>>> True color display is default for all new installation of Windows
>>>>>>> Vista and 7 because it is required for some visual effects new
>> Windows
>>>>>>> use.
>>>>>>>>> Best regards,
>>>>>>>>> Tomasz Janeczko
>>>>>>>>> amibroker.com
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --- In [email protected]
>> <mailto:amibroker%40yahoogroups.com>
>>>>>>> <mailto:amibroker%40yahoogroups.com>, Progster<progster@>  wrote:
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> Is is possible that the AB OLE Automation Object Model call
>>>>>>>>>> ExportImage() is broken in AB 5.30.4?
>>>>>>>>>>
>>>>>>>>>> Despite everything I could think of to try, the images always
>>>>>>> come out
>>>>>>>>>> blank, like those attached.
>>>>>>>>>>
>>>>>>>>>> Neither of the codes below work, and yet each was said to work
>>>>>>> on the
>>>>>>>>>> list in the past.
>>>>>>>>>>
>>>>>>>>>> Operational attempts have included:
>>>>>>>>>>
>>>>>>>>>> AB Open Dbl-Click on script
>>>>>>>>>> AB Open Run script from command window
>>>>>>>>>>
>>>>>>>>>> AB Closed Dbl-Click on script
>>>>>>>>>> AB Closed Run script from command window
>>>>>>>>>>
>>>>>>>>>> Results are always either: server error, AB crash, or it runs and
>>>>>>>>>> produces the blank chart.
>>>>>>>>>>
>>>>>>>>>> When AB is open, it doesn't matter what layout/chart is up.
>>>>>>> Still no joy.
>>>>>>>>>> What could be (not) happening here???
>>>>>>>>>>
>>>>>>>>>> - Progster
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> -----------
>>>>>>>>>>
>>>>>>>>>> // ImageTest_01.js
>>>>>>>>>> AB = new ActiveXObject("Broker.Application");
>>>>>>>>>> AB.ActiveWindow.ExportImage( "test.gif", 640, 480 );
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> // ImageTest_02.js
>>>>>>>>>>
>>>>>>>>>> iWatchList = 8; /// you can define watch list number here
>>>>>>>>>>
>>>>>>>>>> AB = new ActiveXObject("Broker.Application");
>>>>>>>>>> Qty = AB.Stocks.Count; for( i = 0; i<  Qty; i++ )
>>>>>>>>>> {
>>>>>>>>>> Stk = AB.Stocks( i );
>>>>>>>>>> if( iWatchList<  32 )
>>>>>>>>>> {
>>>>>>>>>> if( Stk.WatchListBits&  ( 1<<  iWatchList ) )
>>>>>>>>>> {
>>>>>>>>>> Doc = AB.Documents.Open( Stk.Ticker );
>>>>>>>>>> WScript.Sleep( 4000 ); // 4 seconds delay
>>>>>>>>>> AB.ActiveWindow.ExportImage(Stk.Ticker + ".png")
>>>>>>>>>> Doc.Close();
>>>>>>>>>> }
>>>>>>>>>> }
>>>>>>>>>> else
>>>>>>>>>> {
>>>>>>>>>> if( Stk.WatchListBits2&  ( 1<<  ( iWatchList - 32 )) )
>>>>>>>>>> {
>>>>>>>>>> Doc = AB.Documents.Open( Stk.Ticker );
>>>>>>>>>> AB.ActiveWindow.ExportImage(Stk.Ticker + ".png")
>>>>>>>>>> WScript.Sleep( 4000 ); // 4 seconds delay
>>>>>>>>>> Doc.Close();
>>>>>>>>>> }
>>>>>>>>>> }
>>>>>>>>>> }
>>>>>>>>>>
>>>>>> ------------------------------------
>>>>>>
>>>>>> **** IMPORTANT PLEASE READ ****
>>>>>> This group is for the discussion between users only.
>>>>>> This is *NOT* technical support channel.
>>>>>>
>>>>>> TO GET TECHNICAL SUPPORT send an e-mail directly to
>>>>>> SUPPORT {at} amibroker.com
>>>>>>
>>>>>> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
>>>>>> http://www.amibroker.com/feedback/
>>>>>> (submissions sent via other channels won't be considered)
>>>>>>
>>>>>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>>>>>> http://www.amibroker.com/devlog/
>>>>>>
>>>>>> Yahoo! Groups Links
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> ------------------------------------
>>>>>
>>>>> **** IMPORTANT PLEASE READ ****
>>>>> This group is for the discussion between users only.
>>>>> This is *NOT* technical support channel.
>>>>>
>>>>> TO GET TECHNICAL SUPPORT send an e-mail directly to
>>>>> SUPPORT {at} amibroker.com
>>>>>
>>>>> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
>>>>> http://www.amibroker.com/feedback/
>>>>> (submissions sent via other channels won't be considered)
>>>>>
>>>>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>>>>> http://www.amibroker.com/devlog/
>>>>>
>>>>> Yahoo! Groups Links
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>> ------------------------------------
>>>
>>> **** IMPORTANT PLEASE READ ****
>>> This group is for the discussion between users only.
>>> This is *NOT* technical support channel.
>>>
>>> TO GET TECHNICAL SUPPORT send an e-mail directly to
>>> SUPPORT {at} amibroker.com
>>>
>>> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
>>> http://www.amibroker.com/feedback/
>>> (submissions sent via other channels won't be considered)
>>>
>>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>>> http://www.amibroker.com/devlog/
>>>
>>> Yahoo! Groups Links
>>>
>>>
>>>
>>>
>>
>
> ------------------------------------
>
> **** IMPORTANT PLEASE READ ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
>
> TO GET TECHNICAL SUPPORT send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> Yahoo! Groups Links
>
>
>
>


------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> 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