Click here to Skip to main content
15,912,578 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionAdding permissions for a user on a folder Pin
T John30-Sep-05 10:51
T John30-Sep-05 10:51 
QuestionAny tool to check dependencies? Pin
T John30-Sep-05 10:34
T John30-Sep-05 10:34 
AnswerRe: Any tool to check dependencies? Pin
Daniel Grunwald1-Oct-05 7:34
Daniel Grunwald1-Oct-05 7:34 
AnswerRe: Any tool to check dependencies? Pin
Vasudevan Deepak Kumar2-Oct-05 23:39
Vasudevan Deepak Kumar2-Oct-05 23:39 
QuestionActive windows users Pin
Bounz30-Sep-05 3:38
Bounz30-Sep-05 3:38 
QuestionCut/Copy/Paste for .NETCF Pin
Sevu30-Sep-05 3:12
Sevu30-Sep-05 3:12 
Questionhow to pass messages between java and .net without using sockets Pin
hasansheik30-Sep-05 1:08
hasansheik30-Sep-05 1:08 
AnswerRe: how to pass messages between java and .net without using sockets Pin
Vasudevan Deepak Kumar2-Oct-05 23:31
Vasudevan Deepak Kumar2-Oct-05 23:31 
QuestionWeb services question Pin
Jim Crafton29-Sep-05 3:57
Jim Crafton29-Sep-05 3:57 
QuestionLaunching app from .net button Pin
JohnSantaFe28-Sep-05 12:37
JohnSantaFe28-Sep-05 12:37 
AnswerRe: Launching app from .net button Pin
Mike Ellison28-Sep-05 13:49
Mike Ellison28-Sep-05 13:49 
AnswerRe: Launching app from .net button Pin
JohnSantaFe29-Sep-05 5:29
JohnSantaFe29-Sep-05 5:29 
Questionsetup in silent mode with *.msi? Pin
Ariadne28-Sep-05 5:58
Ariadne28-Sep-05 5:58 
AnswerRe: setup in silent mode with *.msi? Pin
rwestgraham28-Sep-05 9:59
rwestgraham28-Sep-05 9:59 
QuestionError logging for application Pin
ravibabu_kanaparthi27-Sep-05 22:50
ravibabu_kanaparthi27-Sep-05 22:50 
AnswerRe: Error logging for application Pin
rwestgraham28-Sep-05 17:05
rwestgraham28-Sep-05 17:05 
QuestionInstall Shield Pin
_mubashir27-Sep-05 21:53
_mubashir27-Sep-05 21:53 
QuestionError while opening DotNet project Pin
vinidimple27-Sep-05 19:22
vinidimple27-Sep-05 19:22 
QuestionInstaller Problem.. Pin
_mubashir27-Sep-05 18:58
_mubashir27-Sep-05 18:58 
AnswerRe: Installer Problem.. Pin
rwestgraham28-Sep-05 9:17
rwestgraham28-Sep-05 9:17 
Questionimaging code; looking for optimization Pin
sarabjs27-Sep-05 9:23
sarabjs27-Sep-05 9:23 
Hi folks,
The following piece of C#.NET code creates an A4 size binary image by reading values from a two-dimensional byte array iPage[][].
Is there anyway I can further optimize the nested for loop inside the unsafe block? It is taking ~2.2s, and I'd love to bring it down further.
Sarab.

// page dimensions
iwd=iPage.Length;
iht=iPage[0].Length;

// create new bitmap
bMap=new Bitmap(iwd, iht, PixelFormat.Format24bppRgb);

// create bitmap data
bData=bMap.LockBits(new Rectangle (0,0,iwd,iht),ImageLockMode.WriteOnly,PixelFormat.Format24bppRgb);

// get bitmap position
Scan0 = bData.Scan0;
iStride=bData.Stride;

unsafe
{
// initialize pointer
byte *p = (byte*)(void*)Scan0;
int nOffset = iStride-iwd*3;

for(int y=0;y<iht;++y)
{
for(int x=0;x<iwd;++x)
{
if (iPage[x][y]==0) p[0]=p[1]=p[2]=255;
else p[0]=p[1]=p[2]=0;
p += 3;
}
p += nOffset;
}
}

PS. the code above is inspired from the article(s): http://www.codeproject.com/cs/media/csharpgraphicfilters11.asp
AnswerRe: imaging code; looking for optimization Pin
Dave Kreskowiak27-Sep-05 12:01
mveDave Kreskowiak27-Sep-05 12:01 
GeneralRe: imaging code; looking for optimization Pin
sarabjs28-Sep-05 11:26
sarabjs28-Sep-05 11:26 
AnswerRe: imaging code; looking for optimization Pin
Daniel Grunwald30-Sep-05 22:56
Daniel Grunwald30-Sep-05 22:56 
GeneralRe: imaging code; looking for optimization Pin
sarabjs3-Oct-05 6:30
sarabjs3-Oct-05 6:30 

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.