this method saves the current window or whole screen as either a bitmap or
a jpeg It uses paint to save the file, so will barf if a duplicate filename
is selected, or the path doesnt exist etc
* filename - string - the name of the file to save. If its not fully qualified the current directory is used
* active_window - boolean - if true, the whole screen is captured, if false, just the active window is captured
* save_as_bmp - boolean - if true saves the file as a bitmap, saves it as a jpeg otherwise