Click here to Skip to main content
15,898,987 members
Home / Discussions / C#
   

C#

 
GeneralRe: OpenCV Project ? Pin
Henry Minute13-Jul-09 9:01
Henry Minute13-Jul-09 9:01 
GeneralRe: OpenCV Project ? Pin
0x3c013-Jul-09 9:10
0x3c013-Jul-09 9:10 
AnswerRe: OpenCV Project ? Pin
Henry Minute13-Jul-09 9:20
Henry Minute13-Jul-09 9:20 
QuestionReading pdf file as text from the URL. Pin
aakar13-Jul-09 8:08
aakar13-Jul-09 8:08 
AnswerRe: Reading pdf file as text from the URL. Pin
Christian Graus13-Jul-09 8:25
protectorChristian Graus13-Jul-09 8:25 
Questiondecimal value being truncated when exporting data to excel from asp.net c# Pin
vijju0413-Jul-09 8:04
vijju0413-Jul-09 8:04 
AnswerRe: decimal value being truncated when exporting data to excel from asp.net c# Pin
Christian Graus13-Jul-09 8:26
protectorChristian Graus13-Jul-09 8:26 
AnswerRe: decimal value being truncated when exporting data to excel from asp.net c# Pin
paas13-Jul-09 8:33
paas13-Jul-09 8:33 
GeneralRe: decimal value being truncated when exporting data to excel from asp.net c# Pin
vijju0415-Jul-09 8:28
vijju0415-Jul-09 8:28 
AnswerRe: decimal value being truncated when exporting data to excel from asp.net c# Pin
PIEBALDconsult13-Jul-09 8:41
mvePIEBALDconsult13-Jul-09 8:41 
GeneralRe: decimal value being truncated when exporting data to excel from asp.net c# Pin
vijju0415-Jul-09 8:31
vijju0415-Jul-09 8:31 
QuestionSearching in XML Pin
zeeShan anSari13-Jul-09 7:56
zeeShan anSari13-Jul-09 7:56 
AnswerRe: Searching in XML Pin
PIEBALDconsult13-Jul-09 8:18
mvePIEBALDconsult13-Jul-09 8:18 
AnswerRe: Searching in XML Pin
Not Active13-Jul-09 8:19
mentorNot Active13-Jul-09 8:19 
AnswerRe: Searching in XML Pin
0x3c013-Jul-09 8:43
0x3c013-Jul-09 8:43 
GeneralRe: Searching in XML Pin
Not Active13-Jul-09 10:19
mentorNot Active13-Jul-09 10:19 
GeneralRe: Searching in XML Pin
0x3c013-Jul-09 19:54
0x3c013-Jul-09 19:54 
QuestionUnmanaged DLL: C# variable for C++ char** Pin
belier113-Jul-09 7:06
belier113-Jul-09 7:06 
AnswerRe: Unmanaged DLL: C# variable for C++ char** Pin
Luc Pattyn13-Jul-09 7:28
sitebuilderLuc Pattyn13-Jul-09 7:28 
GeneralRe: Unmanaged DLL: C# variable for C++ char** Pin
belier113-Jul-09 9:47
belier113-Jul-09 9:47 
GeneralRe: Unmanaged DLL: C# variable for C++ char** Pin
Luc Pattyn13-Jul-09 10:04
sitebuilderLuc Pattyn13-Jul-09 10:04 
Hi,

when fixed doesn't fit the requirements, GCHandle will. I tend to almost always use GCHandle, even when fixed would suffice. One of the advantages is you typically don't need to copy the data AT ALL, since the scenario is:
1. managed world creates an array
2. uses GCHandle to pin and get the pointer
3. passes it to native world, which fills the buffer, then returns
4. managed world frees GCHandle and uses the array.
See, no copy involved, hence also no performance hit.

If the buffer is really the entire pixel data of a Bitmap, I would try and use Bitmap.Lockbits to pin and get the pointer (it does what GCHandle does for a general object), pass that pointer to the native world, and all would be OK again without a copy operation, provided your native code:
1. applies the right byte ordering within a pixel
2. applies the right pixel ordering
3. applies the right bitmap stride (normally no problem if scanlines are a multiple of 4 bytes, which is true for 32-bit pixels, or image widths that are multiples of 4).

My number 1 rule in image processing is: avoid copy operations.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: Unmanaged DLL: C# variable for C++ char** Pin
belier113-Jul-09 11:07
belier113-Jul-09 11:07 
GeneralRe: Unmanaged DLL: C# variable for C++ char** Pin
Luc Pattyn13-Jul-09 11:12
sitebuilderLuc Pattyn13-Jul-09 11:12 
GeneralRe: Unmanaged DLL: C# variable for C++ char** Pin
belier114-Jul-09 1:10
belier114-Jul-09 1:10 
QuestionGet local groups and users from server remotely with console app Pin
briancollins3213-Jul-09 6:50
briancollins3213-Jul-09 6:50 

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.