Click here to Skip to main content
15,908,175 members
Home / Discussions / C#
   

C#

 
AnswerRe: read video stream from IP Address on 80 port assigned to DVR Pin
#realJSOP13-Jul-09 1:05
professional#realJSOP13-Jul-09 1:05 
GeneralRe: read video stream from IP Address on 80 port assigned to DVR Pin
kunal.tawde13-Jul-09 21:14
kunal.tawde13-Jul-09 21:14 
Questionc#:how to install new font? Pin
lhong100112-Jul-09 19:00
lhong100112-Jul-09 19:00 
AnswerRe: c#:how to install new font? Pin
dan!sh 12-Jul-09 21:44
professional dan!sh 12-Jul-09 21:44 
GeneralRe: c#:how to install new font? Pin
lhong100112-Jul-09 22:15
lhong100112-Jul-09 22:15 
GeneralRe: c#:how to install new font? Pin
Pete O'Hanlon12-Jul-09 22:46
mvePete O'Hanlon12-Jul-09 22:46 
GeneralRe: c#:how to install new font? Pin
dan!sh 12-Jul-09 22:53
professional dan!sh 12-Jul-09 22:53 
QuestionDeleting a Registry Key Gives a Security Exception Pin
Richard Andrew x6412-Jul-09 17:37
professionalRichard Andrew x6412-Jul-09 17:37 
AnswerRe: Deleting a Registry Key Gives a Security Exception Pin
Richard Andrew x6412-Jul-09 17:47
professionalRichard Andrew x6412-Jul-09 17:47 
QuestionHow do i select the radiobutton depending on the info on my textbox? Pin
daffy_200312-Jul-09 16:31
daffy_200312-Jul-09 16:31 
AnswerRe: How do i select the radiobutton depending on the info on my textbox? Pin
PIEBALDconsult12-Jul-09 17:00
mvePIEBALDconsult12-Jul-09 17:00 
GeneralRe: How do i select the radiobutton depending on the info on my textbox? Pin
daffy_200312-Jul-09 17:20
daffy_200312-Jul-09 17:20 
GeneralRe: How do i select the radiobutton depending on the info on my textbox? Pin
peishen8812-Jul-09 17:36
peishen8812-Jul-09 17:36 
GeneralRe: How do i select the radiobutton depending on the info on my textbox? Pin
PIEBALDconsult12-Jul-09 18:20
mvePIEBALDconsult12-Jul-09 18:20 
AnswerRe: How do i select the radiobutton depending on the info on my textbox? Pin
Natza Mitzi12-Jul-09 18:20
Natza Mitzi12-Jul-09 18:20 
GeneralRe: How do i select the radiobutton depending on the info on my textbox? Pin
daffy_200312-Jul-09 18:53
daffy_200312-Jul-09 18:53 
QuestionIssues with adding a web reference using WSDL.exe Pin
Tina P12-Jul-09 13:14
Tina P12-Jul-09 13:14 
AnswerRe: Issues with adding a web reference using WSDL.exe Pin
Ravi Bhavnani12-Jul-09 15:11
professionalRavi Bhavnani12-Jul-09 15:11 
GeneralRe: Issues with adding a web reference using WSDL.exe Pin
Tina P12-Jul-09 15:51
Tina P12-Jul-09 15:51 
GeneralRe: Issues with adding a web reference using WSDL.exe Pin
Ravi Bhavnani12-Jul-09 18:27
professionalRavi Bhavnani12-Jul-09 18:27 
QuestionEntity Framework: Create new Object (when relation exists) PinPopular
TheShihan12-Jul-09 12:58
TheShihan12-Jul-09 12:58 
QuestionWIA with Vista... Pin
Jacob Dixon12-Jul-09 10:08
Jacob Dixon12-Jul-09 10:08 
AnswerRe: WIA with Vista... Pin
Jacob Dixon12-Jul-09 14:45
Jacob Dixon12-Jul-09 14:45 
AnswerRe: WIA with Vista... Pin
Jacob Dixon12-Jul-09 15:28
Jacob Dixon12-Jul-09 15:28 
GeneralRe: WIA with Vista... Pin
Sean Devoy26-Aug-09 14:44
Sean Devoy26-Aug-09 14:44 
I realize this is a little old, but maybe this will help others. My code is in VB but does not take much to convert to C#.

In XP this code takes and saves a picture:
item = dev.ExecuteCommand(CommandID.wiaCommandTakePicture)
Dim myImage As WIA.ImageFile = CType(item.Transfer(format), WIA.ImageFile)
myImage.SaveFile("c:\somewhere\mypicture.jpg")

But in Vista "item" is ALWAYS NULL but it does take the picture on the camera.

here is my fix:
' get current image count
Dim cnt As Int32 = dev.Items.Count

'take picture
 item = dev.ExecuteCommand(CommandID.wiaCommandTakePicture)

 ' insert this single if block
 If IsNothing(item) Then
   ' Vista drops the ball here (and a lot of other places!)
   '  Loop for up to 10 seconds waiting for the image to appear on camera device
    While dev.Items.Count = cnt And x < 10
       System.Threading.Thread.Sleep(1000)
       x+= 1
    End While
    If cnt = dev.Items.Count Then
         'throw your exception here - no image arrived
    Else
         ' we found the new image on the camera
         ' pull it into the "item" variable since Vista didnt
         item = dev.GetItem(dev.Items(cnt - 1).ItemID)
    End If
End If
' and the rest of the code is unchanged.


Hope that helps.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.