Saving SCREEN as a variable.

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
karma
Newbie
Posts: 5
Joined: Sun Jun 21, 2009 2:25 am

Saving SCREEN as a variable.

Post by karma » Wed Jun 24, 2009 8:30 pm

The way I use the image recognition features, it would be useful to me to be able to capture the screen to memory, rather than a file. I am aware of SCREEN, but this is always in reference to the current screen. Can I save SCREEN to a variable stored in memory rather than saving it to the hard drive which is potentially quite slow for many operations?

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Jun 24, 2009 8:40 pm

From help for ScreenCapture>:
Help wrote:ScreenCapture
ScreenCapture>X1,Y1,X2,Y2,Filename
Captures a portion of the screen to a .BMP (bitmap) or .JPG (jpeg) file and to the clipboard.
Use ScreenCapture to capture the image, then use GetClipBoard to put the image to a variable. If you want to know if there is any way to capture the image and not put it to a file try Press Print Screen

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Jun 24, 2009 9:19 pm

Checking into this a little more I don't think my previous suggestion is going to help you. FindImagePos> requires a bitmap file for the needle and either a bitmap file or the system variable "SCREEN" for the haystack. You can assign the screen image to a variable as I suggested but I don't see any way that's going to help you avoid using files.

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

RAMDISK or cache

Post by gdyvig » Thu Jun 25, 2009 1:25 am

Search the forums for RAM DISK or cache.

There is a thread out there promoting the use of a RAMDISK to eliminate saving temp files to hard disk to improve performance.

I thought I saw a thread suggest that files that are frequently overwritten are often never actually written to the hard disk, the OS does it all in cache. Can't find it now, may have seen it elsewhere. If true, you may not have the performance problem you fear.

Run some tests to see if it is really a problem before trying to solve it.

Related threads:


http://www.mjtnet.com/usergroup/viewtop ... 2deacb17be
Read 2nd post by craige288.


http://www.mjtnet.com/usergroup/viewtop ... t=ram+disk
Read the post by ainterne.


Gale

ainterne
Junior Coder
Posts: 29
Joined: Tue Jun 05, 2007 4:03 am

Post by ainterne » Sat Jun 27, 2009 5:51 pm

Hi, I settled on Qsofts ram drive and have been very pleased with it.

The reason is that i can set it to take an image of the ram drive every 15 or 30 mins.... So I don't loose much at all if there is a power down.....but also because it loads the last image at boot.....So it just appears with all my data on boot up.... Does it take a few extra moments to unpack the last image? Yes it does, but I pretty never shut my machine down and so for the few seconds it takes to do that...it's really no problem.

I pretty much always write my temp files etc to ram disk, I use it like a big temp drive. You can also set your temp directories to it.

Phil.
Phil.......

ainterne
Junior Coder
Posts: 29
Joined: Tue Jun 05, 2007 4:03 am

Post by ainterne » Sat Jun 27, 2009 5:52 pm

Hi, I settled on Qsofts ram drive and have been very pleased with it.

The reason is that i can set it to take an image of the ram drive every 15 or 30 mins.... So I don't loose much at all if there is a power down.....but also because it loads the last image at boot.....So it just appears with all my data on boot up.... Does it take a few extra moments to unpack the last image? Yes it does, but I pretty never shut my machine down and so for the few seconds it takes to do that...it's really no problem.

I pretty much always write my temp files etc to ram disk, I use it like a big temp drive. You can also set your temp directories to it.

Phil.
Phil.......

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts