|
Get a direct draw handle for your Control. There is an article somewhere. GDI+ is very slow.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I guess that would be a lot easier than trying to do this with GDI.
I'm doing a screen saver that alternates between images and text. I have the text fading on/off working fine, but fading images is crap in GDI. Heck, it would probably be best to use Directdraw (or whatever it's called nowadays) anyway.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Could you control its opacity. If you use a ColorMatrix and set the Matrix33 starting at 0 and incrementing until 1.0?
Mike
|
|
|
|
|
That's the way I'm doing it now...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Are you using the standard way using OnPaint and Invalidating? If so you might bypass that and do the draw directly and bypass the OnPaint.
private void Draw()
{
Graphics g = ?control?.CreateGraphics();
g.DrawImage(image, rct);
g.Dispose();
}
This way you don't depend on the system to draw it when it gets around to it! May sound a little strange but it does help!
Mike
|
|
|
|
|
Hi,
I have a requirement to delete some data from an excel file in a folder. Like opening and reading an excel file, is it possible to delete the data, the whole data or with some range, from an excel file? Anybody has any idea? Would be great if you could provide any source code also?
Thanks
Meeram395
|
|
|
|
|
You will want to work with the Microsoft Office Excel Object Model. As always, there is much information about it on the Microsoft web site, including source code.
led mike
|
|
|
|
|
I have to insert an & sign into a string, which will be part of an XML file. However, whenever I tried to do it, the & sign turn into & in the string.
Thanks
Terence
|
|
|
|
|
I just found that the & sign doesn't change into & until I convert it to XML, can anyone give me some insight why that is happening?
T
|
|
|
|
|
Hi,
Not quite sure what you mean, but it may be to do with using the & symbol to escape the string. You may have to use & to represent an &
Because certain symbols are reserved, when you want to use them in strings you have to escape them.
Hard to explain, take a look here:
http://www.w3schools.com/xml/xml_cdata.asp[^]
.. not that I've ever found the w3c explanations of anything easy to understand.
Regards,
Rob Philpott.
|
|
|
|
|
I assume you're only detecting this when reading the file back? Or are you opening the file with an editor?
At any rate, your question is unclear, it's possible that you're typing one thing and another is displaying in the message.
It might be better if you showed us the code that writes the file.
At any rate, I've found that using an XmlDocument to write he file is much better than trying to use Write or WriteLine to manually create the file.
|
|
|
|
|
I binded an employee class to the propertygrid control in C#. It's now displaying as follows:
MiddleName
FirstName
LastName
Age
ID
How can I show ID at the very top, then lastname, first name and middle name. I didn't find any property that could do. Is there something i am missing.
thanks
|
|
|
|
|
When you bind an obect to a property grid, it uses reflection to walk through the properties exposed on the object. I would hazzard to guess, based on the little bit of data you provided, is that those are the order that the properties exist in your Employee Class ??!!
One thing to do is to try changing the order. There are also a number of decorators you can use to help with what the property grid exposes. For example [Description()] will populate the decriptor box at the bottom of the property grid when you click on the field. Most of the behavior is not controlled by properties on the grid, but rather the decorators on your fields.
|
|
|
|
|
|
Dear all,
In my program, I have written a method to send out an e-mail. However, my entire GUI freezes for a moment until the e-mail has been sent. I would like to create a worker thread that sends the e-mail ( invoke the method from that thread ) so that my main GUI stays alive and functional.
I've looked through many examples on the net, but they are all a bit of an overkill. I remember there was an easy way of doing it. Can anyone please point me in the right direction.
Cheers,
Rick
|
|
|
|
|
Well, generally speaking, multi-threaded applications are not that simple. However, you can use the BackgroundWorker or ThreadPool, those are the easiest to deal with, especially suitable in situations like yours.
Check thisout:
If you still have issues post back
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed.
Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Coo
|
|
|
|
|
Mustafa Ismail Mustafa wrote: However, you can use the BackgroundWorker or ThreadPool, those are the easiest to deal with, especially suitable in situations like yours.
Wha??? See my post. I dont understand why people want to revert to monsters!
|
|
|
|
|
Hmmm, live and learn. I've never actually had to send an email through C#. Thank you leppie, much obliged
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed.
Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Coo
|
|
|
|
|
leppie wrote: I dont understand why people want to revert to monsters!
OK - I now have an image of Scooby Doo in my head and it's not going away. Thanks for that.
|
|
|
|
|
SmtpClient.SendAsync() , make sure you attach to the SendCompleted event if you want to know it has finished.
|
|
|
|
|
Hello,
I have several precompiled binaries(but not the code) and am looking to make
a GUI to make the use of these binaries more user friendly. I was going to
call the binaries by using createprocess but the problem is when the binaries
run the command propmt flashes up and sort of makes the GUI look messy.
Is there a way I can call these binaries and request that their window/prompt
is not visible?
Thanks
|
|
|
|
|
ProcessStartInfo.CreateNoWindow = true;
|
|
|
|
|
Ylno wrote: I have several precompiled binaries(but not the code) and am looking to make
a GUI to make the use of these binaries more user friendly. I was going to
call the binaries by using createprocess but the problem is when the binaries
run the command propmt flashes up and sort of makes the GUI look messy.
Is there a way I can call these binaries and request that their window/prompt
is not visible?
Yes. Set the CreateNoWindow property in your Process StartInfo to true. See below.
Process cmdLineProcess = new Process();
cmdLineProcess.StartInfo.CreateNoWindow = true;
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Without looping over each element to copy them is there any way I can get a row of a 2d array into a 1d array?
ie something like this, except that would actually be able to compile:
object[,] 2dArray = Get2dArray(...);
object[] 1dArray = 2dArray[1];
Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop.
-- Matthew Faithfull
|
|
|
|
|
What if you declare it as an array of 1d arrays, as follows:
object[][] 2dArray ... Obviously this only works if you have control over the return type of "Get2dArray", but you get the idea. I also don't know if you can cast an object[,] into an object[][] or not, but you could try it. Good luck,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|