Visual Basic Screenshot

Discussion in 'Programmer's Corner' started by Dritech, Sep 27, 2013.

  1. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Hi,

    Is it possible to do a program with Visual Basic where the user inputs 10 different names and every time the SPACE key is pressed, a screenshot is captured which is saved using the pre-inpputed names ??

    Thanks in advance.
     
  2. Synaps3

    Member

    Jun 5, 2013
    67
    2
    Yes, it is. Before I start going into detail, I need to be sure I understand you correctly. So there's one text field on the screen that the user types into. Whenever the space key is pressed it takes a screenshot and then saves it to a file in the same folder as the program with the name of the last entry + ".jpg". Let me know if this sounds good. I can just write the whole source code for you if you'd like.
     
  3. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Hi Synaps3 ,

    Thanks for your help :) This is how I was planning to do it:

    *First the user select a path for where he wants to save the screenshots (ex: desktop)

    *The user is then asked to input different names in a text field. There is no limit of how many names the user can input. (so lest assume the user inputs three different names, which are Screenshot1, Screenshot2 and Screenshot3).

    *After the user press the Next button, the program will capture a screenshot every time the Space key is pressed. The screenshots will automatically be saved to the Desktop (or whatever the path) according to the names given in step 2. (i.e. Space key is pressed- a screenshot is captured and saved as Screenshot1, Space key is pressed for the second time- a second screenshot is captured and saved as Screenshot2 ....)

    Thanks for your help and sorry for my poor English.
     
  4. panic mode

    Senior Member

    Oct 10, 2011
    1,321
    304
    do you expect this to work (respond to space key) regardless if your VB program has focus?
     
  5. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    Are you trying to capture screenshots of the display resulting from some other software that's running?
     
  6. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Yes I have a software with constantly changing results. I did find an off-the-shelf software to take multiple screenshots, but it will not allow you to give each image a name beforehand.
     
  7. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
    Interesting challenge, especially in VB. For a standard application you are going to have a problem that your program will not have focus (i.e. it will not be receiving keyboard inputs) after you have started the other application. Your program could be a very small window in one corner that you click on and then press the space bar to capture the screen. Or you could minimize to the Sys Tray at the bottom right and then click on the Sys Tray icon to do the screen shot rather than pressing the Space Bar. Alternatively you can write a system wide keyboard hook that would send key events to you application even if it is in the background but that is fairly low level...
     
  8. panic mode

    Senior Member

    Oct 10, 2011
    1,321
    304
    why specially in VB? VB is a very powerful programming platform. like any programming task it should be broken down and solved in smaller pieces. just need to place keybd hook and there is tons of code examples...
     
Loading...