CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Saving as BMP

  1. #1
    Join Date
    Jan 2000
    Location
    Netherlands
    Posts
    5

    Saving as BMP

    I found some code on the net to merge to pictures to a third picturebox using the following API calls:
    Private Declare Function SetPixel Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long

    and

    Private Declare Function GetPixel Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long) As Long

    This all works fine but when I try to save the image using the SavePicture command the only result I get is a runtime error 380.

    I can save all the other pictures on my form to a file (BMP) except the pic created with the API-calls.

    What am I doin' wrong ??


  2. #2
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    Re: Saving as BMP

    Haven't checked it, but you can try set pic.Picture = pic.Image
    Not sure if it helps, but I remember that after a bitblit i had to do that before I could save the pic...

    Crazy D @ Work :-)

  3. #3
    Join Date
    Jan 2000
    Location
    Netherlands
    Posts
    5

    Re: Saving as BMP

    Yep that dit work !

    I 've heard it's an odd bug.

    So here's the explanation why it most likely happens:

    When you update a picture, it doesn't change the "picture" property, it
    changes the "image" property. So, you're probably trying to save the
    picture property, which doesn't exist as far as VB cares - it only
    recognizes the image property. (Thanx to Tanner for this......)


  4. #4
    Join Date
    Sep 1999
    Location
    Germany, Cologne
    Posts
    83

    Re: Saving as BMP

    Then ist must beset Bild.picture = Bild.image

    like somebody before me.

    I often read to set image to picture but I did'nt know why. Now I know it. Thanks!


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