Erm, i came across this codes. what does each of them means?
int
pixelSize = (imageData.PixelFormat == PixelFormat.Format8bppIndexed) ? 1 : 3;
int
srcOffset = sourceData.Stride - ((sourceData.PixelFormat == PixelFormat.Format8bppIndexed) ? width : width * 3);
(image.PixelFormat ==
PixelFormat.Format8bppIndexed) ? PixelFormat.Format8bppIndexed : PixelFormat.Format24bppRgb);
for
(int x = 0; x < lineSize; x++, ptr++, ovr++){
v = (int)*ptr - (int)*ovr;*ptr = (v < 0) ? (
byte)-v : (byte)v;}
Thanks for your reply
Nipun TomarPosted Apr 15, 2008, 7:45 AM
This is inline conditional statement, similar to if else statement
(Condition)?execute if true:execute if false
In the code given by you
int pixelSize = (imageData.PixelFormat == PixelFormat.Format8bppIndexed) ? 1 : 3;
pixelsize will be 1 if (imageData.PixelFormat == PixelFormat.Format8bppIndexed) returns true, else pixelsize will be 3
Hope this helps..