|
Yeah I told myself after I got the errors that GDI+ probably wasn't ment to be for this rather than building UIs.
After building a queue I'm still getting problems because it's too much drawings and the loop isn't fast enough to handle the queue which makes it stuck.
So I think I'm just gonna make a big loop that does everything one at a time and get it over with. Next game will be with DirectX or XNA
Thanks for all the help.
|
|
|
|
|
Threading just adds overhead and complexity for something like that.
There is mainly two things going on in your game:
1. Calculating how everyting is moving.
2. Draw it on the screen.
As #2 depends on the result of #1, there isn't really any reason to do these in separate threads. They would just be waiting for each other.
If you split up the work of #1 into a separate thread for each object that you display, it gets even worse. You need to synchronise each object, as you need to access the position of some object from other objects in order to detect collision, and you get a very complex model for something that is otherwise rather simple.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hello,
My application sends E-mail messages to an SMTP server for delivery but each SMTP server has its own configurations such as the number of messages it can send per day.I want your help in how to read or query these configurations.
Dad
|
|
|
|
|
How to save DataSet to exist MDB file?
|
|
|
|
|
With ADO.NET and SQL.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi everybody
I have a problem for open large file in C#.
While I want to open file with 100 MByte size(for example) and read its contents and show in the TextBox, program hanged.
If you know any solution about mentioned matter, I will become very happy for your assistance.
Thank you
Best Regards,
Reza Shojaee
|
|
|
|
|
That is way too much data to display in a TextBox. You need to rethink how you want to display the data. It's not possible to see more than a few kilobytes worth of text on the screen at once anyway.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi Guffa
My Problem not TextBox.
You suppose I want show data from file line by line into TextBox.
My problem is volume of file
Best Regards,
Reza Shojaee
|
|
|
|
|
You can read the file in another thread, this way your GUI should stay respondent. But I still wouldn't read it completely into memory, you will run into OutOfMemoryException s rather quickly. I'd suggest to read smaller chunks of the file as needed.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
A) It's only 100mb. He shouldn't be running out of memory.
B) When memory fills up, Windows pages to disk. He shouldn't be running out of memory.
"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
|
|
|
|
|
Reza Shojaee wrote: My Problem not TextBox.
You suppose I want show data from file line by line into TextBox.
My problem is volume of file
Then I don't understand your question.
What is the problem exactly? What error message do you get?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
A string can theoretically only hold 2,147,483,647 characters. However, on a 32-bit OS, you never have that much contiguous memory available, so you'll probably never be able to create a string that large. Beyond that, no single array or structure can contain more than 1 billion items.
If you're running a 64-bit OS, you will realize larger strings, but you still might not be able to allocate their full size unless you have 4-8gb of RAM.
So, your problem is fragmented memory. With .Net, I'm not sure there's much you can do about it beyond allocating the string at program startup and hope you have enough unfragmented memory at that point. I would also use a StringBuilder object instead of a string because the constructor for a StringBuilder allows you to specify the size of the object, and you can put a try/catch block around the constructor call to make sure the framework didn't have any allocation problems.
"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
modified on Sunday, August 10, 2008 7:23 AM
|
|
|
|
|
Hi my friend
I think my problem with StreamReader solved
StreamReader sr = new StreamReader("c:\\1.psd");<br />
string line;<br />
<br />
while ((line = sr.ReadLine()) != null)
thank you for your helping
Best Regards,
Reza Shojaee
|
|
|
|
|
Also you can use this :
List<string> list = new List<string>();
using (StreamReader sr = new StreamReader(openFileDialog1.FileName))
{
while (sr.Peek() >= 0)
list.Add(sr.ReadLine());
}
|
|
|
|
|
Or simply:
string[] list = File.ReadAllLines(openFileDialog1.FileName);
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
You rarely need to have an entire file in memory all at once; what are you trying to do?
|
|
|
|
|
Hello.
I always wanted to knew that, is possible to create WinForm into the HTML tags.
this means that in our WinForm we use HTML tags to create buttons, menu, text Box, ....
Is it possible ?
Thanks in advance
modified on Saturday, August 9, 2008 7:06 PM
|
|
|
|
|
No. However, if you want to use XAML instead you can do that with WPF.
|
|
|
|
|
You can put a web browser control on your page and point it to local HTML. Not sure why you'd want to tho, HTML is not as rich as winforms
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
hi i wish to use MDI parent kind of thing in my project....
How to carry this out???
csetopper_bhanu
|
|
|
|
|
probably start up with not double posting
|
|
|
|
|
try and understand the requirements or your project. Think : do you really need MDI form??
ask yourself if it is really needed and then if you are stuck, then there are lot of people here to help you.
|
|
|
|
|
I wish to use "MDI parent" kind of thing i my project....
how to carry out this???
My next problem is : what is the syntax of Int32Converter or how to convert a text value to integer value..???
please help me...
csetopper_bhanu
|
|
|
|
|