Iam trying to paint a button to get a shade in a button. Iam using a LinearGradientBrush. The code below Worked but it is taking away the
button1.text also.How do i get the text to show after the button is
I've read an article about fast pixel processing[^] posted in codeproject.
As we all know, the GetPixel() and SetPixel() functions have a lot of overhead.
So... The most common solution I've found so far was to lock the pixels in memory and perform calculations using unsafe code and pointers.
If you look at the source code provided with the article mentioned above, you'll see that AndrewVos ,the writer, does lock the pixels in memory, but instead of looping through pixels using unsafe pointers, he marshals them into an array.
I'm sure that the safe and managed code is better.
After all it IS "safe and managed".
But is it slower/faster than unsafe code?
You should put your code in the Form.Shown event. Yet, notice that it needs .Net version 2.0
If you don't have version 2.0 you may try the Activated event, yet it will be fired evry time you code is activate it. So if you want to run it once, make a bool and set it to false after the first time.
1- this.ClientRectangle => Should be => button1.ClientRectangle
2- base.OnPaint(e); => Why this??
3- How do you define: this.ColorStart, this.ColorEnd, this.GradientMode?? Which colors exactly did you use? Very close gradients may fuse together.
Now try this code:
Graphics g = e.Graphics;
Rectangle rcView = button1.ClientRectangle;
using (LinearGradientBrush brush = new LinearGradientBrush(rcView,Color.DarkGreen, Color.DarkMagenta, 50 ))
Hello, everybody! I've just realised that in a few days (on the 15th September) i have to present a project as an examination for certification in Informatics (still in college, but...). The only thing i lack is an idea. I thought of building an IM client, still, i have no idea how to send the messages from one computer to another (IP adresses, maybe?), so, i'll need a new idea. I know this isn't the best place to ask this question, but, C# is rather the only programming language i know.
--> about the IM client:
i know it must contain a background process that waits for writing from the other computer, a beggining and ending signal of the message, a user interface and... the most important thing (probably because i don't know it): a way to transmit the messages without using a server (because i don't have one and have never worked with one)
please, help me out!
Here are details of source code available from http://www.miranda-im.org/download/[^]for the Miranda IM version 0.5 Open Source Project. Unfortunately it is not written in C# but if you download the source code, I am sure that you will be able to think your way through. This open source project was found here [^] and other IM's and other open source projects are housed here.
HOWEVER, don't you think you have left this college project a little late.
Crazy ain't it that college students just don't know how to organise themselves in terms of time-management. Who in their right mind leaves it until the last minute to start a project that by now should have been completed.
Well, the fact is i have another project done for that exam. The thing is that i am not very sure of it's success (it's a simple idea, exploited to the maximum) and that's why i am trying something new that will sure beat the rivals and get the judges' attention. Anyway, thanks a lot! I appreciate u'r work and support.
i am trying something new that will sure beat the rivals and get the judges' attention.
Then don't do a chat program. Everyone has done that and there are so many examples out there it certainly won't highlight your thoughts and your work. If it were my class you'd get no higher than a C and that would be only if I didn't see your post on Code Project