Topic: Request for AppGraphics

I think in a previous thread Jeff has told me that image capture is only for the active plot window. Would it be possible to make an option to capture the entire created Window - what is created with the "initiwindow" call?

I have another way of doing the screen capture but it requires an outside code to run and file naming is problematic. It would be so much easier if I could do this with a Fortran call or function.

Thanks for your consideration.
Rod

Re: Request for AppGraphics

Rod,

The writeimagefile function will save a portion or the entire window to a file depending on the arguments passed.  A window in AppGraphics is the same as a window in Windows; regions of AppGraphics windows are normally referred to as "viewports."

Dose that answer your question?

Jeff Armstrong
Approximatrix, LLC

Re: Request for AppGraphics

Jeff,

I am not sure I completely understand your answer. I read the "writeimagefile" discussion as saving the active viewport, not the entire window. Based on your answer, perhaps I can do what I want using that command.

Just to confirm, what I am asking for is the ability to save then entire window, like what is seen in my screen capture here (I have updated this image a couple of times since my last posting):

https://flic.kr/p/rnZ1SS

Note, I am referring to the two plot areas in that capture as viewports but it is the entire window that I want to capture and save as a BMP.

The goal is to create a series of screen captures to make into a video of my simulation output.

Perhaps I am just dense with the terminology...
Thanks,
Rod

Re: Request for AppGraphics

Rod,

I understand now.  So yes, writeimagefile will write only the viewport at this time.  It actually has a weird bug where it will start the capture at the top-left corner of the viewport, but will save a picture of the window dimensions, meaning there will be nothing shown on the bottom and right edges.  The situation certainly isn't ideal.

I would suggest "re-setting" the viewport to be the entire window prior to calling the function to save the image file.  That should be how the subroutine works.  The next release will have a corrected writeimagefile that will only capture the current viewport.

Jeff Armstrong
Approximatrix, LLC

Re: Request for AppGraphics

Jeff,

Thanks for the clarification but I have a couple other questions regarding this topic. In regards to the bug that is to be fixed, does that mean that once fixed, one will not be able to select the entire window for screen capture? As to your comment about selecting the entire window, I am unclear as to how to do that. The window is created with the "initwindow command" but after that how do you select it?

One other question I have is, does the "writeimagefile" command perform the capture and writing all as one action? Putting it a different way, if I were to do this manually from the Windows desktop, I would start with a "CNTL Print-Screen" to place a image copy on the clipboard. Then I would do a "CNTL-V" to paste the clipboard contents into an image editing program, followed by a save-as action to save the image in a file. Does "writeimagefile" do all this at once or are there other calls needed to perform these actions? From the description of the "writeimagefile", it isn't totally clear that is what is happening.  Clearly I haven't tried this yet as I am scoping out how to add this capability to the program.

Thanks again for your help and patience.

Rod

Re: Request for AppGraphics

Rod,

Sorry for my delayed response.  The bug I mentioned doesn't affect your ability to capture the entire window.  The problem is the viewports that you have set.  When I said you'd need to "reset" the viewport, I specifically meant that you'd have to set the viewport to be the entire window:

call setviewport(0, 0, getmaxx(), getmaxy(), .TRUE.)
call writeimagefile(filename=myfile)

There is not currently a function to set the viewport to be the entire window (as it is by default when you call initwindow.  You'd have to do it manually as I demonstrated above.  The next version of AppGraphics has a subroutine resetviewport that does this automatically.

The writeimagefile subroutine is pretty flexible.  If you call it with no options whatsoever, it will request a filename, capture the entire window's contents (provided the viewport is the entire window at this time), and save it to the bitmap file selected by the user.  You can optionally specify the filename or the region to capture in the call if you'd prefer.  The example "Conway's Game of Life," included with Simply Fortran on the Start tab, implements a call to the writeimagefile subroutine.

Jeff Armstrong
Approximatrix, LLC

Re: Request for AppGraphics

Thanks Jeff,

That solution should work very well for what I need. I will give it a shot shortly and let you know how it works out. My videos tend to be pretty crude but once I make one, I may post a link.

Rod

Re: Request for AppGraphics

Jeff,

I gave this a try last night and it all works pretty well with the exception that the screen capture does not include the buttons and text boxes. I find this odd but is that the way it is supposed to work? You can see what was captured here:

https://flic.kr/p/t2oskc

and compare that to the usual screen capture here (ignoring content differences of course):

https://flic.kr/p/rnZ1SS

Thanks.

Rod

Re: Request for AppGraphics

Rod,

Yes, not capturing buttons and textboxes is a limitation at the moment due to the way the screen capture is implemented.  Specifically, the writeimagefile function is pulling the drawing surface only.  The textboxes and buttons are actually separate "windows" (in the Windows API sense), and are not captured at the moment.

Jeff Armstrong
Approximatrix, LLC

10 (edited by grogley 2015-06-02 17:45:21)

Re: Request for AppGraphics

Jeff,

Thanks again for your help. Do you have any idea when the screen capture will be reworked to include the buttons and text boxes, or did I misunderstand the intent of fixing it? In any event, I can live with the current behavior and I can perhaps make other arrangements for displaying the information in the text boxes.

Rod

Re: Request for AppGraphics

Rod,

I'm not sure when that would be fixed.  I think the failure to capture buttons is acceptable, but text boxes can and often are used to display information.  I'll look into it for the next version.

Jeff Armstrong
Approximatrix, LLC