Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Screenshot of app status

For general discussion related FlowStone

Screenshot of app status

Postby MicheleANE » Wed Aug 26, 2020 8:19 am

Hello,

First of all, sorry if my question is dumb but I'm quite new at this. Forgive me. Also, forgive me for my English, it's not my first neither my second language.

I use FS to make simple tools for our company workflow and in one of these tools, I would like to be able to create a screenshot of the app with all the input and output fields as they are at that moment when a button is pressed.

I know how to save an image file but I don't understand how to create an image from the app appearance in real time.

Any hint or guidance would be extremely helpful.

Thanks in advance for your time and best regards.
Michele
---Programming to promote laziness---
User avatar
MicheleANE
 
Posts: 8
Joined: Tue Aug 18, 2020 5:15 am

Re: Screenshot of app status

Postby Spogg » Wed Aug 26, 2020 9:04 am

Hello and welcome to the forum!

If you hadn’t said English wasn’t your native language I wouldn’t have guessed! I’m English so the compliment counts! :lol:

I’m not sure I can help but am I right in thinking you want to trigger a screenshot when you click on a control in FlowStone?
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Screenshot of app status

Postby tulamide » Wed Aug 26, 2020 9:18 am

That would only be possible if you make no use of Windows controls. If you draw all the fields with GDI+ (= green prims or Ruby), but not edittext or popup menu or other Windows controls.

Normally you would draw to a view. Instead, you draw to a bitmap (there's a prim for that) and then draw the bitmap to a view. When a button is pressed you then just access the bitmap and save it to disk (another prim exists for that)
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Screenshot of app status

Postby MicheleANE » Wed Aug 26, 2020 9:53 am

@Spogg: Thanks for the undeserved compliment and yes, that is what I would like to obtain.

@tulamide: Thanks for the info. On a vaguely related point, is there a way to extend ruby inside FS with gems or libraries like CSV? If yes, maybe there is a ruby library that makes it possible to capture screenshots...

Thanks again for the help
Best regards
Michele
---Programming to promote laziness---
User avatar
MicheleANE
 
Posts: 8
Joined: Tue Aug 18, 2020 5:15 am

Re: Screenshot of app status

Postby juha_tp » Wed Aug 26, 2020 2:31 pm

As an alternative, there are many free tools for Windows which records the screen either as a screen capture image or as video. Windows 10 has a built-in one - https://betanews.com/2019/01/14/windows ... -ultility/

Record 1st the functionality in question and then save those frames you want to images.
juha_tp
 
Posts: 60
Joined: Fri Nov 09, 2018 10:37 pm

Re: Screenshot of app status

Postby trogluddite » Wed Aug 26, 2020 3:20 pm

MicheleANE wrote:Hello

Welcome to the forum!

Before I start talking about the previous suggestions; there is another possible method: This StackExchange thread suggests a few command-line tools for saving screenshots, which FlowStone would be able to call using the "Shell Execute" primitive (or from Ruby). This may be the simplest solution, given my comments below about other methods.
[EDIT: Aha - I see @juha_tp has had similar thoughts while I was typing!]

MicheleANE wrote:is there a way to extend ruby inside FS with gems or libraries like CSV?

Unfortunately, the way that Ruby has been adapted to work inside FlowStone means that it doesn't support Gems. External code can be loaded using Ruby's "require" method, so long as it is pure Ruby source-code text (".rb" files), but not binary "C-extensions" (".so" files). This strictly limits which external libraries can be used - for example; a screenshot library would have to call the operating system, which may require a "C-extension".

tulamide wrote:Normally you would draw to a view. Instead, you draw to a bitmap...primitive[s] for that...

That's what I thought too - so I decided it would be a nice little "coffee-break puzzle". However, while I can save the bitmap successfully, it also breaks all of the Ruby controls! It seems to create some kind of re-drawing feedback problem because the "screenshot" button is part of the same GUI that's being captured (I've had a similar problem before in a different GUI context). I tried putting some trigger delays in, and testing as an export to make sure the FS workspace wasn't interfering, but that still didn't work. Here's my test schematic - maybe someone else can see where the problem lies?...
Screenshot.fsm
(257.12 KiB) Downloaded 972 times
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Screenshot of app status

Postby tulamide » Wed Aug 26, 2020 7:44 pm

trogluddite wrote:However, while I can save the bitmap successfully, it also breaks all of the Ruby controls!
Screenshot.fsm

I'm not sure if I understand correctly. Do you mean that the controls are drawn differently afterwards, or don't work afterwards?
I used your schematic (didn't export it), and it does what it should. Since no background is drawn, the jpg format set it to all black, which is normal. The elements are drawn (and in the state) as they exist, and I am still able to change text, move the knob and trigger another screenshot afterwards!

A hiccup on your system maybe?

EDIT: I just discovered that clicking the fsm starts the alpha, not 3.0.6! So while it is good to know that the issue is solved in the alpha, I can now confirm that excessive processing (aka feedback loop) is going on in 3.0.6!
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Screenshot of app status

Postby tulamide » Wed Aug 26, 2020 8:30 pm

It's the stock modules, Trog!

All of them have weird code, where somehow repetetive method calling is involved. The button for example uses scheduled events to check if it is still pressed. There are many more code parts in all three modules. I reduced the bitmap view to only one control, the text edit, and removed its (unnecessary) event method definition. This works. But of course it would need more inspection to remove the dangerous code parts from the other controls as well.
Attachments
Screenshot [tula].fsm
(5.63 KiB) Downloaded 936 times
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Screenshot of app status

Postby trogluddite » Wed Aug 26, 2020 11:26 pm

@MicheleANE
Given tulamide's discoveries, I'd definitely recommend a command-line tool automated from FlowStone as the easiest solution (assuming that you can find a tool that meets your needs).

@tulamide
Thanks for looking into that - some great detective work there! Now that you mention it, the other, similar bug that I mentioned was also something that Maik already had on his "to do" list (maybe exactly the same thing, I don't recall what he said the cause was).
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Screenshot of app status

Postby MicheleANE » Thu Aug 27, 2020 1:24 am

Thanks everyone for your efforts and helps.

I am very new to FS, just started using it last week, so I will need sometime to incorporate all these new info.

I will post something if I ever reach a good solution.
Michele
---Programming to promote laziness---
User avatar
MicheleANE
 
Posts: 8
Joined: Tue Aug 18, 2020 5:15 am

Next

Return to General

Who is online

Users browsing this forum: No registered users and 49 guests