|
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
|
|
|
|
|
|
If you mean MSDE it should be under the VS.Net folder. For example:
c:\Program Files\Microsoft Visual Studio .NET\Setup\MSDE\
Robert
|
|
|
|
|
Yes, that's it thanks.
/\ |_ E X E GG
|
|
|
|
|
Ok...
now what exactly is the timer for...
Actually timing how long it takes somthing to finish...
or for,
scheduling somthing to execute at a certain time...
???
/\ |_ E X E GG
|
|
|
|
|
A timer is for repeatedly (or once) doing something at a specified interval - for use if you want to do something once every xx seconds.
GetTickCount() or QueryPerformanceCounter() is used for finding out how long something takes to complete.
"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
|
|
|
|
|
MSDN says it retrieves the number of milliseconds the system has been running...
how could I it to tell how long it was since a for loop started 'till it ends?
|
|
|
|
|
By calling it before you start, and then again when you finished, and subtracting the starting number from the ending number. This will give you the number of milliseconds the operation took.
int ctr=GetTickCount();
ctr=GetTickCount-ctr;
"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
|
|
|
|