Results 1 to 2 of 2

Thread: Picturebox problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2003
    Posts
    22

    Picturebox problem

    I tried to save the image from the picturebox to the dataset and it always show the error "A generic error occurred in GDI+" in the second line which saving the pic to memory stream.

    my codes are:
    Dim tmpStream As New MemoryStream()
    Me.PictureBox1.Image.Save(tmpStream, ImageFormat.Jpeg)
    Dim BLOBData(tmpStream.Length - 1) As Byte
    tmpStream.Position = 0
    tmpStream.Read(BLOBData, 0, tmpStream.Length)
    dr_teacher("ti_photo") = BLOBData


    Anyone knows whats wrong? And how can I "clear" the image in the picturebox dynamically in code?

    Regards,
    Calvin

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by yellowcat
    And how can I "clear" the image in the picturebox dynamically in code?
    VB Code:
    1. PictureBox1.Image = Nothing

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