CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2000
    Location
    Netherlands
    Posts
    71

    SavePicture fails to save

    Hi,

    I have an appl. that save an image from a Picture control. From one moment to another the SavePicture command fails to save Bitmaps from the Picture Control.

    Nothing changed to this part of the appl. but now I get only a grey (appl.background color) image as .BMP file.

    The code used is:

    sFile = "C:\MYIMAGE.BMP"
    SavePicture Picture1.Image, sFile




    What went wrong and how can I solve this problem. I tried the compiled code on another PC and that also doesn't work corrcetly.


    Thanks,

    Jeroen.



  2. #2
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: SavePicture fails to save

    Maybe the Autoredraw property of your picturebox is false. Set it to true.


  3. #3
    Join Date
    Oct 2000
    Location
    Netherlands
    Posts
    71

    Re: SavePicture fails to save

    Thanks,

    That solved the problem, strange things worked fine for a while and suddenly it went wrong (after changing the capture source from Windows Media Player to VidCap32 content).

    Anyway, everything works fine now.


    Regards,

    Jeroen.


  4. #4
    Join Date
    Oct 2000
    Location
    Netherlands
    Posts
    71

    A new problem came up

    After having saved the image every 30 secs. for about 1600 times, the size of the file becomes 0 bytes!!!

    After restarting the application, all works fine for about 1600 times. The captured image is OK, the saved one is empty....


    HELP!!!!!!


    Jeroen.


  5. #5
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: A new problem came up

    Not clear why, but you can try this:


    sFile = "C:\MYIMAGE.BMP"
    If Dir$(sFile) <>"" then Kill sFile
    SavePicture Picture1.Image, sFile





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured