Link to home
Start Free TrialLog in
Avatar of meteor73
meteor73

asked on

Save an image

Dear experts,


I'm now trying to write vb codes to capture the image from the scanner and store it into the file with bmp format.  It has no problem on scanning and storing, but when I open the stored image using picture box or image box, it appears an error message "invalid picture".  But the image file can open with the MS Paint or Imaging.  The related code are as follow:

Private Sub Command1_Click()
ImgScan1.StartScan
End Sub

Private Sub Form_Load()
FileSystem.ChDir ("C:\My Documents\Collector")
Image1.Picture = LoadPicture("temp.bmp")
End Sub

Private Sub ImgScan1_ScanDone()
ImgEdit1.SaveAs "temp.bmp"
Image1.Picture = LoadPicture("temp.bmp")
End Sub

Where ImgScan1 and ImgEdit1 are the components of the Kodak Image Control Lib.
What's wrong with the code?  And how can I load the scanned pictures with the command "LoadPicture()"?
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Avatar of evanir
evanir

move ur loadpicture code into clicked event of a button n try. there is nothing worng in ur code. maybe the file system has to be refreshed before loading into the image control.


ASKER CERTIFIED SOLUTION
Avatar of meteor73
meteor73

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned.  I will make a recommendation to the moderators on its resolution in approximately one week.  I would appreciate any comments by the experts that would help me in making a recommendation.

It is assumed that any participant not responding to this request is no longer interested in its final deposition.

If the asker does not know how to close the question, the options are here:
https://www.experts-exchange.com/help/closing.jsp

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer