Click here to Skip to main content
15,860,972 members
Home / Discussions / C#
   

C#

 
GeneralRe: AppDomain pains: Specifying a relative directory not working fully. Pin
iAmEntity8-Feb-09 5:59
iAmEntity8-Feb-09 5:59 
GeneralRe: AppDomain pains: Specifying a relative directory not working fully. Pin
Eddy Vluggen8-Feb-09 6:31
professionalEddy Vluggen8-Feb-09 6:31 
GeneralRe: AppDomain pains: Specifying a relative directory not working fully. Pin
iAmEntity8-Feb-09 8:08
iAmEntity8-Feb-09 8:08 
Questionhow to write coding for login page in ASP dot net with c# coding???? Pin
karthimca1437-Feb-09 8:55
karthimca1437-Feb-09 8:55 
AnswerRe: how to write coding for login page in ASP dot net with c# coding???? Pin
DaveyM697-Feb-09 10:11
professionalDaveyM697-Feb-09 10:11 
QuestionEfficient Image loading Pin
RanCohen7-Feb-09 8:45
RanCohen7-Feb-09 8:45 
AnswerRe: Efficient Image loading Pin
Luc Pattyn7-Feb-09 9:15
sitebuilderLuc Pattyn7-Feb-09 9:15 
GeneralRe: Efficient Image loading Pin
RanCohen7-Feb-09 9:43
RanCohen7-Feb-09 9:43 
Thanks for the reply. It doesn't run slow (actually it runs very fast), I just wanted to know if there is a more efficient way to do it. I am building a program that makes a picture mosaic from a given directory of images, which can be made from thousand images with different sizes.

I don't believe that I can improve GetAvgPixelVal() and it runs quite fast. The code for it is this:

unsafe private Color GetAvgPixelVal(Bitmap bmp)
{
			Color RetVal;
			int r = 0;
			int g = 0;
			int b = 0;
			int nWidth = bmp.Width;
			int nHeight = bmp.Height;

			BitmapData data = bmp.LockBits(new Rectangle(0, 0,
				nWidth, nHeight), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);

			int remain = data.Stride - data.Width * 3;

			byte* ptr = (byte*)data.Scan0;

			for (int i = 0; i < nHeight; i++)
			{
				for (int j = 0; j < nWidth; j++)
				{
					b += ptr[0];
					g += ptr[1];
					r += ptr[2];
					ptr += 3;
				}
				ptr += remain;
			}

			bmp.UnlockBits(data);

			RetVal = Color.FromArgb(r / (nWidth * nHeight), g / (nWidth * nHeight), b / (nWidth * nHeight));
			return (RetVal);
}

AnswerRe: Efficient Image loading Pin
Luc Pattyn7-Feb-09 10:34
sitebuilderLuc Pattyn7-Feb-09 10:34 
GeneralRe: Efficient Image loading Pin
RanCohen7-Feb-09 10:36
RanCohen7-Feb-09 10:36 
AnswerRe: Efficient Image loading Pin
Alan Balkany9-Feb-09 4:17
Alan Balkany9-Feb-09 4:17 
GeneralRe: Efficient Image loading Pin
RanCohen10-Feb-09 4:41
RanCohen10-Feb-09 4:41 
Questionhow to make .exe file in C# Pin
jananiSreedhar7-Feb-09 7:50
jananiSreedhar7-Feb-09 7:50 
AnswerRe: how to make .exe file in C# Pin
Anthony Mushrow7-Feb-09 7:57
professionalAnthony Mushrow7-Feb-09 7:57 
JokeRe: how to make .exe file in C# Pin
Luc Pattyn7-Feb-09 9:17
sitebuilderLuc Pattyn7-Feb-09 9:17 
QuestionPlugins and Abstract classes. Pin
iAmEntity7-Feb-09 6:45
iAmEntity7-Feb-09 6:45 
AnswerRe: Plugins and Abstract classes. Pin
Anthony Mushrow7-Feb-09 7:54
professionalAnthony Mushrow7-Feb-09 7:54 
RantRe: Plugins and Abstract classes. Pin
iAmEntity7-Feb-09 8:05
iAmEntity7-Feb-09 8:05 
GeneralRe: Plugins and Abstract classes. Pin
Anthony Mushrow7-Feb-09 9:03
professionalAnthony Mushrow7-Feb-09 9:03 
GeneralRe: Plugins and Abstract classes. Pin
iAmEntity7-Feb-09 9:33
iAmEntity7-Feb-09 9:33 
QuestionChecking for data Pin
ziwez07-Feb-09 5:07
ziwez07-Feb-09 5:07 
AnswerRe: Checking for data Pin
Dave Kreskowiak7-Feb-09 8:54
mveDave Kreskowiak7-Feb-09 8:54 
GeneralRe: Checking for data Pin
DaveyM697-Feb-09 10:14
professionalDaveyM697-Feb-09 10:14 
GeneralRe: Checking for data Pin
Dave Kreskowiak7-Feb-09 11:47
mveDave Kreskowiak7-Feb-09 11:47 
QuestionVoice to text Conversion in windows mobile application Pin
ReachMe@CodeProject7-Feb-09 3:55
ReachMe@CodeProject7-Feb-09 3:55 

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.