|
One suggestion. Timers are not perfect, so I'd get the time from DateTime.Now and show a difference, if you want it to be perfect. I'd also update twice a second, so it doesn't ever skip a number.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I don't understand how to set an Icon. After you add the icon file to the solution explorer, and set it to the form, the icon always makes a page picture, not the icon I chose. Please help, thanks in advance!
|
|
|
|
|
You could:
A) add the icon as a resource and retrieve it and set it programatically
or
B) rename your icon file to App.ico and drop it into your solution's folder
B is the quick and dirty way of doing it
---
http://iheartdotnet.blogspot.com/
|
|
|
|
|
i want to make a programe to convert numbers to alphapitic with c#
example:
1200 when it convert ,it will be
one thousand and two hundreds
|
|
|
|
|
see here[^] and here.[^]
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|
|
|
This is a very easy and standard homework problem. Do it yourself!
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
i think it is your class assignment .............
I AM WORKING ON "PLOTTER ROBOT"(FYP).
|
|
|
|
|
memaia wrote: i want to make a programe to convert numbers to alphapitic with c#
Permission granted. Please, proceed.
|
|
|
|
|
You should email his teacher
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
"There is a program that does that very thing right here on code project already.
http://www.codeproject.com/cs/design/TestFirstDevelopment.asp[^]
Remember: Google is your friend. "
Gosh Colin - how ever did you come up with that link so quickly? And how come you didn't comment on his use of such a rubbish post title?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: And how come you didn't comment on his use of such a rubbish post title?
I'm getting old.
|
|
|
|
|
Colin Angus Mackay wrote: I'm getting old.
As long as you're not mellowing.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
The real question is why he didn't mention SQL injection attacks.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
A well deserved 5 sir.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
you dont have any other work...MR.Pete O'Hanlon
|
|
|
|
|
What are you on about?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
suppose
bmp1 = new Bitmap(530, 335);<br />
bmp2 = new Bitmap(250, 200);
in which, bmp1 contains an image but bmp2 is empty
now,
bmp2 = new Bitmap(bmp1);
Since there are diffrence between the size of bmp1 and bmp2,so image of bmp2 losing the pixels due to the shrinking.
Am i right? i know i right.......
but i want shrink the desir pixels like
bmp1 = new Bitmap(bmp, 530, 335);<br />
bmp2 = new Bitmap(530, 335);<br />
Graphics gg = Graphics.FromImage(bmp2);<br />
p = new Pen(Color.Red, 1);<br />
for (i = 0; i < bmp1.Width; i++)<br />
{<br />
for (j = 0; j < bmp1.Height; j++)<br />
if (bmp1.GetPixel(i, j) == Color.FromArgb(255, 0, 0) && <br />
bmp1.GetPixel(i + 1, j) == Color.FromArgb(255, 0, 0)&&<br />
bmp1.GetPixel(i + 2, j) == Color.FromArgb(255, 0, 0)&&<br />
bmp1.GetPixel(i + 3, j) == Color.FromArgb(255, 0, 0)&&<br />
bmp1.GetPixel(i + 4, j) == Color.FromArgb(255, 0, 0)&&<br />
bmp1.GetPixel(i + 5, j) == Color.FromArgb(255, 0, 0))<br />
{<br />
gg.DrawEllipse(p, i, j, 1, 1); this.Invalidate();<br />
<br />
i += 6;<br />
}<br />
means that sense the only red pixels,if 6 pixels are in one row then change these six red pixels with the one pixel.
like
RRRRRRRRRRRBBBBRRRRRRRRRRBBBBBBBBBBBRRRRRR R=red,B=blue
R R RBBBBR R BBBBBBBBBBBR
iS it right method?is it efficeint method? for reducing the length of line of desire color.
i am confuse
I AM WORKING ON "PLOTTER ROBOT"(FYP).
|
|
|
|
|
zeeShan anSari wrote: bmp1 = new Bitmap(530, 335);
bmp2 = new Bitmap(250, 200);
in which, bmp1 contains an image but bmp2 is empty
now,
bmp2 = new Bitmap(bmp1);
Since there are diffrence between the size of bmp1 and bmp2,so image of bmp2 losing the pixels due to the shrinking.
Am i right? i know i right.......
No.
You create bmp2 as a bitmap of 250 by 200 pixels
You then create a new bitmap based on bmp1 and assign it to the variable that WAS holding the reference to the bitmap you previously created. This previously created bitmap no longer has any references to it and the garbage collector will get it.
|
|
|
|
|
and now,
bmp2 = new Bitmap(bmp1,250,200);
I AM WORKING ON "PLOTTER ROBOT"(FYP).
|
|
|
|
|
Is there a way to do this using .net 2
thx
|
|
|
|
|
Try this[^].
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi guys
I have problem running a remote WMI query in my threaded application.
What I am doing is querying allot of clients 5000+ in our network, after a while WMI starts returning wired random exceptions like RPC service is not available.
I’m using C# .NET 2.0
I’m using the Treading.Treadpool.
WMI is working fine on the clients. Both remote and locally.
It’s W2k clients
So basically my question is doesn’t WMI play nice in a multithreaded environment?
/Johan
|
|
|
|
|
What are some of the other exceptions? Are you cleaning up the WMI connections correct? From a command prompt you can run "netstat -an" to see if your local box has lots of ports open (LISTENING) or in TIME_WAIT.
I'm assuming you are not reusing the same WMI object in more than one thread at a time.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi Tom
Thanks for the reply. I have allot of ports in TIME_WAIT. They dosent seem to be relesed. I dont know why they dont get relesed.
Do i need to do anything more??
public bool ServiceRunning(string n, string q)
{
ConnectionOptions co = new ConnectionOptions();
TimeSpan ts = new TimeSpan(1000);
co.Timeout = ts;
ManagementScope ms = new ManagementScope("\\\\" + n + "\\root\\cimv2", co);
ObjectQuery oQuery = new ObjectQuery(q);
ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(ms, oQuery);
ManagementObjectCollection objCol = null;
try
{
objCol = oSearcher.Get();
_WMIStatus = "WMI Running";
if (objCol.Count > 0)
{
return true;
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
finally
{
objCol.Dispose();
oSearcher.Dispose();
}
|
|
|
|