WIA copying then deleting a photo
Posted on 2007-04-04
I have received code that will delete the images off my digital camera using WIA.
I also have code that will copy to a HDD.
Is there someone who could help me to put these two together- i.e. within the procedure for copying the photo, an if statement (based on check box) determines if the photo should be copied then deleted...
I got this code from another post:
For Each Itm In dev.Items
Dim f As Properties
Set f = Itm.Properties
Dim str As String
'is the item a file? (could also be a dir or so)
If (f.Item("Item Flags") And ImageItemFlag) = ImageItemFlag Then
'check if the file exist locally (create your own function!)
'If f.Item("Item Name") <> "nameoflocalfile" Then
Set imgpic = Itm.Transfer
'store the file name and extension and app.path in a string,
'so you can use it to perform more operations on it
str = App.Path & "\downloaded images\" & f.Item("Item Name") & "." & imgpic.FileExtension
'save the file (default format is used, bmp stays bmp, jpg stays jpg
'this is why we switched to version 2.0 of the lib!
'you can process the image further here, it is now stored on your pc!
'(add it to a list, to an picturebox, or whatever!)
what I would like to do is have the if chkdelete statement somewhere here so that the photo is copied then deleted.....