Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

SRP Save Screenshot bmp file corrupted

I haven't had any success in using the SRP_Save_Screenshot subroutine. It will save a bmp file, but when I attempt to open it in any image software (Paint, Photoshop, Windows Photo Viewer, etc.) it brings a message that the file is corrupt, or fails. When I set the OLE.Image property of the SRP Picture Control to the file that is saved by the subroutine, it shows the image, but it is distorted. Any thoughts?

Comments

  • What OS was this performed in? I wrote that routine a long time ago and am wondering if capturing screen regions requires a different approach in Vista on up.
  • I tried it on a terminal server in Windows Server 2008 R2 and it doesn't even show the picture in the SRP Picture Control at all.
  • Dan, by "distorted" per chance are you seeing the left half display on the right and vice-versa?
  • Yes. The image is also shifted downward cutting off the bottom portion of it.
  • I wanted to resurrect this thread and see if you have an update on the SRP_Save_Screenshot that will allow it to work on Windows 7 and up. Attempting to view the saved bmp file, I currently am getting an error message on any image viewer that says that the file is corrupted.
  • Has all your testing been inside Win 2008 terminal server?
  • No. I haven't actually even tested in that OS. I've done testing in Windows XP and Windows 7. Windows XP would show the saved image distorted, but Windows 7 just says it is corrupted. I don't use XP anymore.
  • I have tested in various OS's and copies of OI and cannot recreate this. I'm thinking perhaps it has something to do with the contents of the form. Do have another way of taking a screenshot of the form you are testing against so I can see what controls are on there? Or, you could send an RDK of a form. Either way. My email is kfournier@srpcs.com.
  • HI Kevin,
    While attempting to use SRP_Save_Screenshot utility and OIPI preview window, I can't seem to get the image to come out either.

    I'm doing the following:
    oFile = "C:\temp\srpu.bmp"
    SRP_Save_Screenshot(@WINDOW,oFile,0)

    Stat = Set_Printer("INIT","","","","",2)
    Stat = Set_Printer("BMP",oFile)
    Stat = Set_Printer("TERM")

    I verified that the image (or something) is being created and saved to C:\temp and has data (1071 Kb).

    However trying to view it through MSPaint gives me the same error "Prattspets" was getting.

    The OIPI Preview looks like this... I'm using OI 9.4 and am RDP'd into a WS 2008r2 64bit server. Thanks.
    image
  • Hi bcameron,
    I determined that I received the file error you are experiencing when I would use RDP with my display settings lower than "Highest Quality (32 bit)". Once I set the display settings to the "Highest Quality" the screenshots would be saved correctly (without corruption). Hope you can find the same results.
  • Thanks for the reply Prattspets.
    However, I don't seem to have the options or ability to change display setting to Highest Quality.
    image
    image
  • Ah yes. This issue has caused problems in other ways as well. If this is Win 2008 terminal server, you have to actually enable 32-bit color on the terminal server settings. We have instructions on how to do that here.
Sign In or Register to comment.