Click here to Skip to main content
15,887,267 members
Home / Discussions / C#
   

C#

 
QuestionFormat date to system timezone Pin
Tony Pottier14-Mar-09 6:24
Tony Pottier14-Mar-09 6:24 
AnswerRe: Format date to system timezone Pin
Christian Graus14-Mar-09 8:15
protectorChristian Graus14-Mar-09 8:15 
QuestionPInvoke void * parameter Pin
Jason McPeak14-Mar-09 5:32
Jason McPeak14-Mar-09 5:32 
AnswerRe: PInvoke void * parameter Pin
Luc Pattyn14-Mar-09 5:56
sitebuilderLuc Pattyn14-Mar-09 5:56 
GeneralRe: PInvoke void * parameter Pin
Jason McPeak14-Mar-09 7:02
Jason McPeak14-Mar-09 7:02 
GeneralRe: PInvoke void * parameter Pin
Luc Pattyn14-Mar-09 7:30
sitebuilderLuc Pattyn14-Mar-09 7:30 
GeneralRe: PInvoke void * parameter Pin
Jason McPeak14-Mar-09 8:16
Jason McPeak14-Mar-09 8:16 
GeneralRe: PInvoke void * parameter Pin
Luc Pattyn14-Mar-09 9:10
sitebuilderLuc Pattyn14-Mar-09 9:10 
Hi Jason,

The C demo code is interesting, here are some facts:
1. the image buffer needs to be allocated by the caller of the library, we got that right.
2. DcamGetImageSize is used to obtain the image sizes in pixels, and nImageSize is counting pixels, not bytes.
3. the demo code shows a big wait loop polling with DcamWait, so DcamCaptureReverseX is only starting the image capture, not waiting for it to get integrated, scanned, converted and presented in the array, hence the buffer is still untouched at that point in time.

and one strong suspicion:
1. Not sure what the second parameter of DcamCaptureReverseX is meant to be, they have 2*nImageSize, so that probably means size of the buffer in bytes, where each pixel takes 2 bytes (that fits the fact they have a WORD array, WORD=16-bit; however it is in contradiction with the memset where they clear only one byte per pixel); and your C# code does not match up, since you don't have the 2* at all.

my suggestions:
1. I would switch from int pixels to ushort pixels, allowing for 16-bit unsigned values. I now think your camera is a grayscale CCD with at best 16 bits of resolution. If less than 16 bits, the unsigned wouldn't matter at all. Don't forget the factor 2 in the DcamCaptureReverseX call.
2. you need to include a wait scheme; it needs to be inside the fixed block, since the buffer should not be unpinned for as long as the library is using it or going to use it.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


GeneralRe: PInvoke void * parameter Pin
Jason McPeak14-Mar-09 14:10
Jason McPeak14-Mar-09 14:10 
GeneralRe: PInvoke void * parameter Pin
Luc Pattyn14-Mar-09 16:01
sitebuilderLuc Pattyn14-Mar-09 16:01 
AnswerRe: PInvoke void * parameter Pin
Jason McPeak14-Mar-09 7:12
Jason McPeak14-Mar-09 7:12 
QuestionCan not submit to the server. [modified] Pin
sohighthesky14-Mar-09 5:21
sohighthesky14-Mar-09 5:21 
AnswerRe: Can not submit to the server. Pin
Xmen Real 14-Mar-09 5:56
professional Xmen Real 14-Mar-09 5:56 
AnswerRe: Can not submit to the server. Pin
Navneet Hegde14-Mar-09 8:53
Navneet Hegde14-Mar-09 8:53 
QuestionHow to execute Class without Main? [modified] Pin
Akash Chavhan14-Mar-09 5:19
Akash Chavhan14-Mar-09 5:19 
AnswerRe: How to execute Class without Main? [modified] Pin
Eslam Afifi14-Mar-09 5:51
Eslam Afifi14-Mar-09 5:51 
AnswerRe: How to execute Class without Main? Pin
Xmen Real 14-Mar-09 5:53
professional Xmen Real 14-Mar-09 5:53 
AnswerRe: How to execute Class without Main? Pin
Christian Graus14-Mar-09 8:18
protectorChristian Graus14-Mar-09 8:18 
AnswerRe: How to execute Class without Main? Pin
PIEBALDconsult14-Mar-09 15:00
mvePIEBALDconsult14-Mar-09 15:00 
QuestionSockets in C# Pin
mrithula814-Mar-09 4:42
mrithula814-Mar-09 4:42 
AnswerRe: Sockets in C# Pin
Luc Pattyn14-Mar-09 5:01
sitebuilderLuc Pattyn14-Mar-09 5:01 
AnswerRe: Sockets in C# [modified] Pin
Member 349379914-Mar-09 7:02
Member 349379914-Mar-09 7:02 
GeneralRe: Sockets in C# Pin
mrithula814-Mar-09 20:21
mrithula814-Mar-09 20:21 
QuestionRe: Sockets in C# Pin
Jimmanuel15-Mar-09 1:14
Jimmanuel15-Mar-09 1:14 
GeneralRe: Sockets in C# [modified] Pin
mrithula814-Mar-09 22:06
mrithula814-Mar-09 22:06 

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.