Click here to Skip to main content
15,886,258 members

Comments by Mark Salsbery (Top 200 by date)

Mark Salsbery 27-Nov-11 14:40pm View    
>>"and since my variable is typed short int"

Sorry about that. Regardless, you HAVE to use the data pointer and stride values returned by lockbits. You can't assume anything. The stride can even be negative. So use stride/2 (When using pointer arithmetic I prefer to use Byte* then cast to an Int16* in the inner loop, but that's just me). 16bppgrayscale is not supported anyway (or has very limited support) so you may still struggle with that!
Mark Salsbery 26-Nov-11 11:05am View    
and this

LinePtr = ptr + (i * height);

should be something like this

LinePtr = ptr + (i * stride);
Mark Salsbery 26-Nov-11 11:00am View    
If you already know this then why aren't you doing it? The exception is coming from a textbox so you know you have to use the dispatcher. You're always invoking a mehod, not "calling UI elements".
Mark Salsbery 25-Nov-11 18:52pm View    
Last time I checked, that pixel format isn't supported so to even get that far is lucky. Just always use the stride returned by the system :)
Mark Salsbery 24-Nov-11 13:36pm View    
Doesn't seem to be supported in XAML. See posts here for alternatives... XAML - Setting value on nested property ?[^]