|
|
You're right.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
|
I've been doing some testing with the HttpWebRequest object returned from WebRequest.Create(sURL) method and found that the timeout property is not very precise.
It often times out after more than twice the value I set. For example it takes about 30 seconds for a timeout value of 15000. I’ve seen it take 15 seconds for a value of 5000.
Plus or minus a few seconds I could let slip but what might be the reason for more than doubling the timeout value?
(I tested the timeout by turning the power off to my cable modem. My computer is connected to the modem through a router which I left on.)
|
|
|
|
|
Is this happening in a separate thread? How many threads might there be running simultaneously?
|
|
|
|
|
I've been doing all my tests in a new "test" solution right in the constructor of Form1. So its only one thread. hmmm.... I wonder if its the debugger that is causing this. I will have to test it in a Release version.
|
|
|
|
|
Certainly try it outside of the debugger ("Start Without Debugging"). A Release build shouldn't be necessary, but it would be interesting if it did...
|
|
|
|
|
Hi, if anyone has not seen these controls, you should, they are really good.
Anyway, the problem is this. The comboBox in these controls, was inherited and modified, and now I cannot find the SelectedValue option. Does anyone know how to re-enable this?
|
|
|
|
|
Talking about the look and feel of the controls - I would say they are nice. But this is exactly the reason I don't like custom contols.
In this case the problems is very easy to solve. Just call comboBox.SelectedItem and convert it to string if you need.
For this comboBox control he derived form his own custom class ButtonEdit & attached his own ComboListBox based on ListBoxBase. Just look at the source and it should make everything clear
|
|
|
|
|
Hi, I went into the control, and added the following. I have never done this before, so not sure what I am doing wrong - but I get a stack overflow error.
Sorry about how bad the code looks in this box, but the parts without ;'s are wraparounds.
[Browsable(false)]
public int SelectedValue
{
get
{
if(this.SelectedValue != -1)
{
return ((System.Windows.Forms.ListBox)this.internalListBox).Items.IndexOf(this.SelectedValue);
}
else
{
return -1;
}
}
set
{
if(value > -1 && value < ((System.Windows.Forms.ListBox)this.internalListBox).Items.Count)
{
((System.Windows.Forms.ListBox)this.internalListBox).SelectedValue = ((System.Windows.Forms.ListBox)this.internalListBox).Items[value];
this.Text = ((System.Windows.Forms.ListBox)this.internalListBox).SelectedValue.ToString();
}
}
}
|
|
|
|
|
Is there a way to reduce the color depth (in bits) of an image (whether it is saved or in a Bitmap form) in c#? If possible, please include a sample code.
|
|
|
|
|
There might be a simpler way, but this way works:
Bitmap newbmp=new Bitmap(format,bmp.Width,bm.Height);
Graphics newbmpgr=Graphics.FromImage((Image)newbmp);
newbmpgr.DrawImageUnscaled((Image)bmp,0,0);
newbmpgr.Dispose();
Remember that if you convert the image from another format into 8-bit indexed color, you will have to set the palette entries yourself before doing the DrawImageUnscaled() call.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I was trying to convert a 1024x768 image and i got an out of memory error (i have around 200mb free out of 512mb so that's not possible). Is there a workaround?
|
|
|
|
|
|
|
Ok i've just tried again but changed the pixelformat to PixelFormat.Format24bppRgb but the filesize and the color depth did not change at all (i saved newbmp as png).
|
|
|
|
|
So what's your starting pixel format and what's your new pixel format?
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I'm using the default which is 32bpp i think, i didn't change the pixelformat for the original, only the destination one as mentioned earlier to 24bpp...
|
|
|
|
|
Internally, GDI+ represents all bitmap/drawing data as 32bpp. As far as I am aware, none of the standard Microsoft image codecs (bmp,jpg,png,etc...) will do any sort of color conversion for you.
--
Russell Morris
"So, broccoli, mother says you're good for me... but I'm afraid I'm no good for you!" - Stewy
|
|
|
|
|
Hello,
I have to patch an existing web application, which has multiple layers and components and is deployed on many servers. Which is the way to do this in .net?
Thanks,
Don Miguel
|
|
|
|
|
|
Hi!
I get a data in double[100,100]. but i have to transfer it into a function which accept double[]. I just "(double [])data", but doesn't permit.
Any idea?
|
|
|
|
|
novachen wrote:
Hi!
I get a data in double[100,100]. but i have to transfer it into a function which accept double[]. I just "(double [])data", but doesn't permit.
Any idea?
You can't. You only can pass double[n], where 0 <= n < 100. As an alternative, copy the whole double[100,100] to a linear double[10000].
while (!sorted)
;
|
|
|
|
|
UH... isn't the sql server installization file stored somewhere once you install vs.net???
where is it... if i remember correctly it was kinda hidden...
/\ |_ E X E GG
|
|
|
|
|