Which for loop isn't working, the i loop or the q loop? For one thing, if the typo above is the only typo, you have the return statement at the end of the "for i" loop. That means it will only go through that code block the first time, then return from the function. Maybe you should put the...
If you are using Visual C++ Express (the free version), it doesn't come automatically ready to program win32 stuff. You have to install the Microsoft Platform SDK separately to even have the windows.h header file on your computer. The website cpjust posted will show you how to download it and...
Yeah, I just found that out. /MT includes everything the program needs to run within the exe so it doesn't depend on anything else. That makes the exe much bigger. But is it true that /MT includes only what the program needs and not everything that the dll contains? If that is true, then you...
Public Joe's has a decent one that teaches a lot about GDI+.
http://www.publicjoe.f9.co.uk/csharp/tut.html
Another good one about C# basics, but not about window programming is:
http://www.softsteel.co.uk/tutorials/cSharp/contents.html
I would browse through the second one first. If he is...
Oddball,
You were right. I forgot to tell you when it was finished. I have been done for a while. I ended up sticking with the GDI and using a solid color background, but I think it turned out just as good. If you want to check it out, it is a free download on download.com. Just go there...
In case anyone cares, I found out that using the managed DirectX AudioVideoPlayback namespace is just as easy as using a SoundPlayer class, and with DirectX I can play multiple audio sources and multiple file formats. It works much better, and it's easy to use.
I know how to play an audio file using the SoundPlayer class, but I have only been able to play one sound at a time. If I am playing a sound, and I try to play another sound, it stops the first one to play the second one. And that is with two separately declared SoundPlayer objects. So, is...
I kind of thought DirectX might be the way to go, but I don't know anything about it yet. I have the DX SDL, but I haven't gotten into it yet.
As for using Graphics.DrawImage, I have already tried that, and it did speed things up, just not nearly enough. I am thinking about for this project...
Well, it's a jumbled mess, but I'll try to pick out what I did that pertains to what you wrote.
I made the DoubleBufferPictureBox class that you showed.
Then in the main window class, in the class scope, I defined:
DoubleBufferPictureBox myBackground = new DoubleBufferPictureBox();
then in...
I was wondering if maybe you meant that I should have
base.OnPaint(e);
in the OnPaint handler?
if so, I tried that and didn't get any errors, but it didn't display the image in my window. What am I leaving out?
Well, I tried what you suggested and putting the base.Paint(e); didn't work. It said "The event System.Windows.Forms.Control.Paint can only appear on the left hand side of += or -="
I'm new at c#/.NET so maybe I'm overlooking something obvious here?
I am using c#/.NET with GDI to program my version of the classic snake game where the snake moves around trying not to crash, and everytime it eats something it gets longer.
I started off with just a solid background color:
this.BackColor = Color.SomeColor;
And I got pretty high speeds out of...
Thank you alphanytz. That is what I was looking for. I assume that on Linux the Path.DirectorySeparatorChar would be '/', and that I wouldn't have to distinguish between this and Path.AltDirectoryChar?
I know this is kind of a crazy question, but in Python when I make a string with a path to a file, I can use os.sep which means that if it is being used in Windows it's the "\" character and in Linux/unix it's the "/" character. Is there anything like this in c#?
The reason I'm asking is...
I just found the solution thanks to a man named Kevin Delafield. It is as follows:
button.Enabled = false;
button.Update();
MySound.PlaySync();
Application.DoEvents();
button.Enabled = true;
this worked perfectly.
I have a form where a certain button plays an audio file that is about 3 seconds long. I am using System.Media.SoundPlayer.PlaySync() because I don't want the user to do anything while the audio is playing. So my code is something like.
button.Enabled = false;
MySound.PlaySync()...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.