|
can anyone suggest a good website for grapjics programming with C#. i want to create a game using C#. my graphics need would be primarily restrcited to landscape creation.
|
|
|
|
|
First decide what will you use.
DirectX or OpenGL?
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
The problem with my program right now is that it will be ran on pIII-400's. When I switch language from english to chinese in my program, the program blanks out all the pictures, and takes a while to switch language. (ie, It looks like its frozen for a bit)
Is there any way to make it so that it finishes changing the stuff in the background first, and then update the visual, so that it doesnt loo likek its frozen? It seems like its busy updating stuff in the background thats why the UI doesnt get the response time.
|
|
|
|
|
All the GUI proccessing is done in one thread.
If you have any operations that are not realeted to the GUI, then you can create a new thread and do the proccessiin there.
That way the GUI will function normally.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi ,
I am working in C# 2.0 Windows Application . I would like to know how to send data [ Graph , Table ] directly to the printer.
I will have a form to get the user options. say for example 1. Graph 2. Table Values
if user selects Opt 1 then Graph alone should be sent to printer viceversa
Any help will be highly appreciated.
Regards
Vijaykishan
|
|
|
|
|
how to execute a text file, which contains sql script of a database.
I need to execute this file in my code.. i tried this function:
private void ExecSqlFileProcess(String fileName)
{
if (! File.Exists(fileName))
{
MessageBox.Show ("Specified .SQL File Not Found.","Net Fare Database Upgrade Tool",MessageBoxButtons.OK);
return;
}
using (StreamReader sr = new StreamReader(fileName))
{
String line,line1;
String sqlLine= "" ;
while ((line = sr.ReadLine()) != null)
{
line1 = line.Trim();
int compareResult = String.Compare(line1, "GO", true, CultureInfo.InvariantCulture);
if(compareResult != 0)
sqlLine += line + Environment.NewLine ;
//sqlLine += line + c.ToString() ;
else
{
if(sqlLine != "")
{
try
{
int i = SqlHelper.ExecuteNonQuery(connectionString,CommandType.Text,"USE "+DatabaseName+" "+sqlLine);
}
catch(Exception Ex)
{
MessageBox.Show (Ex.Message.ToString(),"Net Fare Database Upgrade Tool",MessageBoxButtons.OK ,MessageBoxIcon.Error );;
sqlLine = "";
}
}
sqlLine = "";
}
}//While
}//Using
}
but i got the following errors for all stored procedure scripts..but it dropped the stored procedure..it only did not create it..following error comes:
'Create Procedure' must be first statement in the query batch.
Must declare variable @IATACodeName, @IATADescription..etc..
|
|
|
|
|
|
Use the combo boxes SelectedIndexChanged event.
private void mycombobox_SelectedIndexChanged(object sender, System.EventARgs e)<br />
{<br />
\\Code Here<br />
}
|
|
|
|
|
I am having a problem with this method:
private void UniversalRegEx(string szMyRegEx, string szWhatFor)
{
//The universal RegEx
//Set it (Query, What it will put as a heading)
Regex rxFind = new Regex((szMyRegEx), RegexOptions.IgnoreCase);
MatchCollection matches = rxFind.Matches(szTibiaProfile);
foreach(Match m in matches)
{
string szTemp = szWhatFor + ": {0}", m.Groups["mmatch"];
WriteLookup(szTemp);
}
return;
}
See the problem? It says this is wrong:
string szTemp = szWhatFor + ": {0}", m.Groups["mmatch"];
Thanks for the help.
Example of passed data:
//Get Character Name
UniversalRegEx(">Name <mmatch>[a-z]+)", "Name");
|
|
|
|
|
replace this line
string szTemp = szWhatFor + ": {0}", m.Groups["mmatch"];
with
string szTemp = szWhatFor + ": "+ m.Groups["mmatch"];
|
|
|
|
|
That works now, thanks. But what did I do wrong with the way I set it up? In my console app that works.
|
|
|
|
|
In your console app, this is a valid function call:
Console.WriteLine("Here is my string: {0}", myString);
but without this function:
"Here is my string: {0}", myString; //this is not valid syntax.
If you want to define a string like this, use the String.Format function.
String.Format("Here is my string: {0}", myString); //this is valid
Otherwise, use proper syntax:
"Here is my string: " + myString; //this is valid syntax.
|
|
|
|
|
Oh, thanks alot. Wasn't sure if it was a reference I needed or what. Thanks alot man.
|
|
|
|
|
Hi,
I need to display some DirectDraw surface (.dds) files in my application (Not my choice, that's the stuff I've been given). Is this possible without using DirectX? If not, can I somehow use DirectX to load the dds into a PictureBox?
Thanks.
|
|
|
|
|
You can initialize DirectX to draw into any control you want.
If you are looking for a quick way to do some DX you should look at this: http://www.3dlevel.com/gamedev/news.php
this is a game engine build with VB.NET and uses managed DX. Very simple, takes only a few lines to show a sprite or whatever...
So if you don't want to learn all the DX stuff this is defenitly the way to go.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hello i have a toolbar in my application and i have visual styles enabled. when i enabled visual styles it wont show the icons in my toolbar otherwise it when visual styles arent enabled it shows the icons. Is there a way to have visual styles enabled and to show my toolbar icons
Thanks
|
|
|
|
|
This is caused by a bug in the .NET framework. You can work around it by calling Application.DoEvents() after enabling visual styles like this...
static void Main()
{
Application.EnableVisualStyles();
<code>Application.DoEvents();</code>
Application.Run(new MyForm());
}
-- modified at 23:35 Tuesday 14th February, 2006
|
|
|
|
|
I am working on a scanning project. The scanners I am working with do not support TWAIN job control. We are wanting to fake job control by using solid black pages as our job control pages. The TWAIN software I am using gives me a DIB per page that is scanned. I want to inspect the DIB during scanning and start a new image when I find a solid black image. I have look around but can't find anything that does this. I was wondering if anybody had a suggestion. Please let me know.
Thanks,
Dave
|
|
|
|
|
Hi,
I've built an xml schema hierarchy where, for instance, {path, file} is a schema type and subsequently {params_1, params_2, ...} each import a {path, file} type. I include code below.
My question is this: How to resolve use of namespaces and hierarchical schema design with C# xml consumption.
From C# I do this:
reader = new XmlTextReader(config_filename);
xmldoc = new XmlDocument();
xmldoc.Load(reader);
Then this:
XmlNode n = doc.SelectSingleNode( "session/gateway/file" )
This instruction returns 'null'. I believe its because the xml doc reads <ns1:file> rather than <file>. However, I want <ns1:file> (or whatever namespace) because I want to have reusable schema patterns.
(Note doc.SelectSingleNode( "session/gateway" ) and ...( "session" ) do work.)
The reason I'm doing SelectSingleNode( x ) is to populate a HashTable with specific values possibly available in the xml.
Finally, here's a snippet of my xml doc. Thanks in advance.
<?xml version="1.0" encoding="UTF-8"?>
<session xmlns:ns1="foo" xmlns:ns2="bar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="baz.xsd">
<gateway>
<ns1:path>(/ns1:path>
<ns1:file>"gateway.xml"</ns1:file>
</gateway>
<strats>
<ns1:path></ns1:path>
<ns1:file>"strats.xml"</ns1:file>
</strats>
<log>
<ns1:path></ns1:path>
<ns1:file>"session.log"</ns1:file>
</log>
</session>
-- modified at 7:17 Wednesday 15th February, 2006
|
|
|
|
|
You need to use a XmlNamespaceManager .
string xml =
@"<?xml version=""1.0"" encoding=""UTF-8""?>
<session xmlns:ns1=""foo"" xmlns:ns2=""bar"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:noNamespaceSchemaLocation=""baz.xsd"">
<gateway>
<ns1:path></ns1:path>
<ns1:file>""gateway.xml""</ns1:file>
</gateway>
<strats>
<ns1:path></ns1:path>
<ns1:file>""strats.xml""</ns1:file>
</strats>
<log>
<ns1:path></ns1:path>
<ns1:file>""session.log""</ns1:file>
</log>
</session>";
XmlDocument doc = new XmlDocument();
doc.LoadXml(xml);
XmlNamespaceManager nm = new XmlNamespaceManager(doc.NameTable);
nm.AddNamespace("ns1", "foo");
XmlNode node = doc.SelectSingleNode("session/gateway/ns1:file", nm);
if(node != null)
Console.WriteLine(node.OuterXml);
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
So this means my C# code guts must know the namespace and namespace aliases used in the xml schema? You write
nm.AddNamespace("ns1", "foo");
Isn't this fragile to schema changes?
Does XmlSchema allow for importing my schema, against which the xml doc was created, so that the namespace and namespace aliases are imported?
-- modified at 8:46 Wednesday 15th February, 2006
|
|
|
|
|
Your C# code must know the namespaces. The namespace prefixes are immaterial. The code that I submitted to you would work just as well if I made the following changes.
nm.AddNamespace("goobledygoobledygook", "foo");
XmlNode node = doc.SelectSingleNode("session/gateway/goobledygoobledygook:file", nm);
if(node != null)
Console.WriteLine(node.OuterXml); The prefixes are aliases, as you point out. However, to get to a node that belongs in another namespace, you will have to know to which namespace that node belongs. The file node, for example, lives in another namespace. Because of that, your C# code (and you!) will have to handle that.
If you don't want to deal with the namespaces, use a regular expression to remove all prefixes from the string representation (i.e., XML source) and put that into an XmlDocument .
|
|
|
|
|
Curtis, thank you for your time on this. Perhaps you can respond to the larger question. I have XMLSpy and it is natural (to me) to build reusable schemas which I 'type' (including a namespace) and then import into a larger schema. Then I build xml doc's against this schema.
On the C# side ideally I'd just like to traverse the node tree. So I've learned that either I keep a namespace table to read the hierarchical xml docs, or I flatten the schemas into 1 level, or I use your suggestion of cleaning the doc using regex.
What do you consider 'best practices' here?
Thank you.
|
|
|
|
|
That's a tough one. If you use XPath, then you'll have to perform one of the three. In that case, I would recommend using the method that would present the simplest solution to you. The three, in practice, have a common outcome; thus, you should choose the one with which you feel most comfortable.
I hope that input helps.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
hi
how can i get or make an Icon for execute(exe) file in my project?
thanks !
s_mostafa_h
|
|
|
|