Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # just ignore width and height variables
- width, height, bmp = Win32::Screenshot.foreground
- File.open("c:/images/foreground.bmp", "wb") {|io| io.write(bmp)}
- # ignore them even more by using special variable names
- _, _, bmp = Win32::Screenshot.foreground
- File.open("c:/images/foreground.bmp", "wb") {|io| io.write(bmp)}
- # just use the Array#[] with index
- result = Win32::Screenshot.foreground
- File.open("c:/images/foreground.bmp", "wb") {|io| io.write(result[2])}
- # or use the Array#last method
- result = Win32::Screenshot.foreground
- File.open("c:/images/foreground.bmp", "wb") {|io| io.write(result.last)}
Add Comment
Please, Sign In to add comment