Click here to Skip to main content
14,669,200 members
Home » Discussions » C#
   

C#

 
Questiondeserialization of object and then populating form Pin
ThorTheBraveGod10-Jun-09 6:13
MemberThorTheBraveGod10-Jun-09 6:13 
AnswerRe: deserialization of object and then populating form Pin
Ennis Ray Lynch, Jr.10-Jun-09 6:31
MemberEnnis Ray Lynch, Jr.10-Jun-09 6:31 
AnswerRe: deserialization of object and then populating form Pin
Henry Minute10-Jun-09 6:35
MemberHenry Minute10-Jun-09 6:35 
GeneralRe: deserialization of object and then populating form Pin
ThorTheBraveGod10-Jun-09 8:06
MemberThorTheBraveGod10-Jun-09 8:06 
GeneralRe: deserialization of object and then populating form Pin
Henry Minute10-Jun-09 8:48
MemberHenry Minute10-Jun-09 8:48 
RantRe: deserialization of object and then populating form Pin
ThorTheBraveGod10-Jun-09 9:10
MemberThorTheBraveGod10-Jun-09 9:10 
GeneralRe: deserialization of object and then populating form Pin
Henry Minute10-Jun-09 9:12
MemberHenry Minute10-Jun-09 9:12 
Questionurgent help pleasse [image processing , pointers , byte ] Pin
WinSolution10-Jun-09 6:10
MemberWinSolution10-Jun-09 6:10 
Hi Everyone

please look at following two line this is not working when i execute my prject

int div = Convert.ToInt32(textBox1.Text.Trim());
ptr[0] = ptr[1] = ptr[2] = (byte)((ptr[0] + ptr[1] + ptr[2]) / div);

but if i remove the first line and enter an integer value in place of div variable it works such as following line.

ptr[0] = ptr[1] = ptr[2] = (byte)((ptr[0] + ptr[1] + ptr[2]) / 3);

Following is the full listing may it help you to figurout the problem
a method that convert a bitmap from colored to grayscale
//////////////////////////////////////////////////////////////////////////

public Bitmap GrayScale(Bitmap bmpimg)
{
BitmapData bmpData = bmpimg.LockBits(new Rectangle(0, 0, bmpimg.Width, bmpimg.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int remain = bmpData.Stride - bmpData.Width * 3;

unsafe
{
byte* ptr = (byte*)bmpData.Scan0;

for (int i = 0; i < bmpData.Height; i++)
{
for (int j = 0; j < bmpData.Width; j++)
{
int div = Convert.ToInt32(textBox1.Text.Trim());
ptr[0] = ptr[1] = ptr[2] = (byte)((ptr[0] + ptr[1] + ptr[2]) / div);

ptr += 3;
}
ptr += remain;
}
}

bmpimg.UnlockBits(bmpData);

return bmpimg;
}
AnswerRe: urgent help pleasse [image processing , pointers , byte ] Pin
Luc Pattyn10-Jun-09 6:29
sitebuilderLuc Pattyn10-Jun-09 6:29 
AnswerRe: urgent help pleasse [image processing , pointers , byte ] Pin
Henry Minute10-Jun-09 6:31
MemberHenry Minute10-Jun-09 6:31 
AnswerRe: urgent help pleasse [image processing , pointers , byte ] Pin
WinSolution10-Jun-09 6:38
MemberWinSolution10-Jun-09 6:38 
GeneralRe: urgent help pleasse [image processing , pointers , byte ] Pin
Luc Pattyn10-Jun-09 7:29
sitebuilderLuc Pattyn10-Jun-09 7:29 
GeneralRe: urgent help pleasse [image processing , pointers , byte ] Pin
Christian Graus10-Jun-09 8:46
mveChristian Graus10-Jun-09 8:46 
AnswerRe: urgent help pleasse [image processing , pointers , byte ] Pin
saurabh sahay10-Jun-09 11:50
Membersaurabh sahay10-Jun-09 11:50 
QuestionHttpResponse Compression... ? Pin
Trapper-Hell10-Jun-09 5:54
MemberTrapper-Hell10-Jun-09 5:54 
AnswerRe: HttpResponse Compression... ? Pin
Colin Angus Mackay10-Jun-09 6:15
MemberColin Angus Mackay10-Jun-09 6:15 
AnswerRe: HttpResponse Compression... ? Pin
saurabh sahay10-Jun-09 6:18
Membersaurabh sahay10-Jun-09 6:18 
GeneralRe: HttpResponse Compression... ? Pin
Trapper-Hell10-Jun-09 6:25
MemberTrapper-Hell10-Jun-09 6:25 
GeneralRe: HttpResponse Compression... ? Pin
saurabh sahay10-Jun-09 6:35
Membersaurabh sahay10-Jun-09 6:35 
QuestionExtracting Repeating Table Data In a Web Part Pin
lday8610-Jun-09 5:42
Memberlday8610-Jun-09 5:42 
Questionchanging the color and text of the label control dynamically from the retrieved values from the database Pin
praveenkumar_vittaboina10-Jun-09 4:58
Memberpraveenkumar_vittaboina10-Jun-09 4:58 
AnswerRe: changing the color and text of the label control dynamically from the retrieved values from the database Pin
Tom Deketelaere10-Jun-09 5:22
professionalTom Deketelaere10-Jun-09 5:22 
Questioncrystal reports problem after installing the application. Pin
praveenkumar_vittaboina10-Jun-09 4:57
Memberpraveenkumar_vittaboina10-Jun-09 4:57 
AnswerRe: crystal reports problem after installing the application. Pin
Tom Deketelaere10-Jun-09 5:19
professionalTom Deketelaere10-Jun-09 5:19 
QuestionChecking a registry key exists Pin
Martin3108810-Jun-09 4:21
MemberMartin3108810-Jun-09 4:21 

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.