Okay, thanks a lot, it works now. I guess the only complain I have is that the file it creates is around 3.8 MB. I have a program Screenshot Utility, the image format is JPG and the file is always less than 100 KB, sometimes even 60 KB, and the quality is very good also. If there's something I can change in this code to produce images with smaller size that will help a lot so if someone knows please let me know or if there's some other code that creates the pics in jpg format etc, but if not I guess I can live with the code I already have.