|
I'm glad you brought shearing to my attention, i was not aware of it.
As far as the OCR goes, I would have a very fast machine dedicated to doing this one function of monitoring text.
I do not need to get every single frame. The text is only entered by humans and in a sense can be logged graphically. I could easily limit things to grabbing 1 frame every 60 or even every 120.
What I do need to be able to do is to get past the shearing.
The only thing i can think of to get past this is to somehow preempt the rendering pipeline of the graphics card and capture a complete frame buffer. If i capture a complete buffer then I'm pretty much assured that its not half of the new frame overwriting half of the old frame. If the screen was updateing during that z-buffer flip then i can just have the OCR drop everything that it doesn't pick up. If one line of the text has an unrecognizeable character, I just drop the posting of that line and wait until the text scroll animation has been completed. Remember, none of the frames have to actually be displayed to screen, which saves some cycles. It just has to be captured into a readable format. Hopefully there is another way without haveing to use the screen output as a proxy to the z-buffer.
Anyone know how I can get the z-buffer information? Is there an API method that lets me pipe the graphic output of the game into another app for processing?
|
|
|
|
|
Kataric wrote: Is there an API method that lets me pipe the graphic output of the game into another app for processing?
Is there an API to do this?? No.
Kataric wrote: The only thing i can think of to get past this is to somehow preempt the rendering pipeline of the graphics card and capture a complete frame buffer
Good Luck with that. The only way you could even come close to doing this is if you injected code into the game process. This is something that cannot be done with managed code. You'll have to write this part in unmanaged C++ to support the exports and static linking required to do DLL injection.
|
|
|
|
|
I'd like to use c# by the way to do this. If no managed code can handle it, I'll go back to c++.
|
|
|
|
|
I have added a large number of jpg files to my project's resource file of a windows application. How do I programmatically get to these images in C# code. I need a code sample please.
joe
|
|
|
|
|
Your_Name_Space.Properties.Resources.Your_Resourse;
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I am having issues with the NewWindow event of the WebBrowser control in .NET 2.0. If I click on any links with a target of _blank I am expecting it to open my new form with the browser control in it. What happens is that it opens my form and then Internet Explorer 7 on top of that with the contents I was expecting to appear in my form. Is there a way for me to stop it from opening IE? Has anyone had this issue before?
-Mike S.
|
|
|
|
|
You can suppress popups, but any popups will open IE ( and IE is what you've got open all along, it has no idea it's in your form )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
That is still confusing to me. It is not really your typical popup because it was a link that I clicked on. I wasn't something opened by script code in the HTML code. So if I am controlling the event and telling it to open a new form with a browser control in it why would it override that and open a second window on top of that? I did see in my Google searches that people referenced something called NewWindow2 and NewWindow3 but that doesn't seem to be available for trapping under the web browser control.
|
|
|
|
|
I should mention that this worked correctly under the old ActiveX browser that we were using before.
|
|
|
|
|
The NewWindow event fires AFTER you click on a link that opens a new window (OR) use the "Open in a New Window" context menu (AND) BEFORE the new window actually opens. To cut the crap, this wont open a new Form with another webbrowser control on it. It'll only launch a new IE window.
If you want to open a new Windows Form, you've to put in your own code that opens a new Form with another web browser control and cancel the event so that IE is not launched.
SG
|
|
|
|
|
Once I was able to keep in mind that another event was firing to create the IE instance then I was able to cancel it and figure out what my other issues were. Thank you very much!
|
|
|
|
|
Hi,
I am new to C# Xml programming. Basically, I am trying to save a XML file to a database. I found that if I just take the below string and try to save it a table which contain a XML datatype column, it creates a SQL Exception:
SqlException: XML parsing: line 1, character 38, unable to switch the encoding
String Test_PSQ1 = @"<?xml version=""1.0"" encoding=""UTF-8""?><Data Type=""Query"" Version=""2.1""><Query Product=""Test""></Query></Data>";
I couldn’t find a good way to switch this encoding on my end in order to be able to save to the database, since SQL Server expects UTF-16 data. I tried to switch the encoding to UTF-16(Unicode) using the below cod but when I try to save to the database get an “illegal xml character” error. Moreover the data in alteredText looks like garbage data.
MemoryStream memStream = new MemoryStream();
StreamWriter swUtf16 = new StreamWriter(memStream, Encoding.UTF8, Test_PSQ1.Length);
swUtf16.WriteLine(Test_PSQ1);
int length = Convert.ToInt32(memStream.Length);
byte[] buffer = new byte[length];
memStream.Write(buffer, 0, length);
memStream.Seek(0, SeekOrigin.Begin);
String alteredText = System.Text.Encoding.Unicode.GetString(memStream.GetBuffer());
I did some investigation and found that, If I can remove “<?xml version=""1.0"" encoding=""UTF-8""?>” part from the XML string, the save would work fine. I am trying to do some XML parsing so that I can strip out this tag, but am unable to do so.
MemoryStream memStream = new MemoryStream();
StreamWriter swUtf16 = new StreamWriter(memStream, Encoding.Unicode, Test_PSQ1.Length);
swUtf16.WriteLine(Test_PSQ1);
int length = Convert.ToInt32(memStream.Length);
byte[] buffer = new byte[length];
memStream.Write(buffer, 0, length);
memStream.Seek(0, SeekOrigin.Begin);
XmlReader reader = new XmlTextReader(memStream);
test = reader.ReadElementString();
test = reader.Value;
if (reader.NodeType == XmlNodeType.Element)
{
test = reader.Value; ;
}
reader.Read();
if (reader.NodeType == XmlNodeType.Element)
{
test = reader.Value; ;
}
Any suggestions about the code, pointing to resources would be highly appreciated.
|
|
|
|
|
This should work:
XmlReader reader = new XmlTextReader(memStream);
reader.MoveToContent();
string NewXmlText = reader.ReadOuterXml();
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
Hello everyone,
I am trying to place an image into a button. The Image originally is placed in the DataGridView and using the following code I am placing it in the desited button.
btnItemImage0.Image = (Image)dataGridView1.Rows[ItemRowIndex0 - 1].Cells["item_image"].FormattedValue;<br />
The images have different sizes (They are mainly bigger than the button size!). Can someone tell me how I can resize the image to make sure the entire image is visiable in the button?
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
You can create instance of Bitmap class and specify sizes
|
|
|
|
|
I am having problems saving changes made in a datagrid to a database. I am using SqlDataAdapters with a generic "Select * FROM tbl" to load a dataset. I then assign the one table at a time to the control listing the contents of the table (all the tables are lookups for the application). Everything works great up to the point that the data is not being saved back to the server. It looks like it works. The problem is that it does not appear that the values in the datagrid are loaded back to the datatable. Here is how I am loading the grid (I am assuming that I am missing something basic here):
<br />
SqlDataAdapter adp = new SqlDataAdapter("SELECT * FROM [" + sTmp + "];", dbConn);<br />
dbTableAdp.Add(adp);
adp.FillSchema(dbSet, SchemaType.Source, sTmp);<br />
adp.Fill(dbSet, sTmp);<br />
adp.AcceptChangesDuringUpdate = true;<br />
adp.ContinueUpdateOnError = true;<br />
<br />
DataTable dt = dbSet.Tables["tablename"];<br />
if (dt != null)<br />
{<br />
dgLookups.DataSource = dt;<br />
}<br />
<br />
if (row.IsCurrentRowDirty == true)<br />
{<br />
DataRow dr = dbSet.Tables["tablename"].Rows[e.RowIndex];<br />
if (MessageBox.Show("Do you wish to commit changes to the database (Yes/No)?",<br />
"Values Changed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==<br />
DialogResult.Yes)<br />
{<br />
DataGridViewRow dgr = dgLookups.Rows[e.RowIndex];<br />
dgr.SetValues();<br />
dr.AcceptChanges();<br />
}<br />
else
{<br />
dr.RejectChanges();<br />
}<br />
}<br />
I am fairly new to using the DataGrid. I have tended toward using ListView since I normally don't allow direct access to the database. Any assistance will be a great help.
Leo T. Smith
Senior Programmer
|
|
|
|
|
Try this.
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi,
I developed a Transactional Server that receives at leat a transaction per second.
The application has a pool of threads that resolve each incoming transaction. This threads use reflection for dynamic execution of generated source code. If the execution returns 0 the program send an approval. If the executions returns 0, the application creates a thread to notify the adminitrators of the systems.
The thread join was resolve creating a CollectorThread that receives a reference of every thread and it wait to them to die.
The application is working well, except for one issue. When each thread uses the Reflection to create the Dinamic execution the memory grows about 80kb, after that I disposed the object and wait for the garbage collector to clean that memory.
When the app is running in Windows XP everything seems to work just fine. But, when the app is running in Windows 2003 ( Dual Core 2 ) the memory grows and grows and it's never collect by the GC.
I also try the AppConfig GCServer option, but it didn't fixed the issue.
Somebody knows something about a bug with the Framework 2.0 in Windows 2003? Is there something else that reflection? (Besides programming my own parser)
Thanks.
rmga
|
|
|
|
|
Hi,
gc runs automatically when it needs to run (i.e. when free memory is needed and
not available); if your Win2003 machine has more memory,
or your process is allowed a larger working set, gc will not run (or only much
later).
So my guess would be there is no problem at all. You could try to (dis)prove this
by reducing the working conditions e.g. adding other, unrelated processes, and/or
changing system parameters reducing the default or max working set (which may
be larger on any Windows server).
BTW I do not recommend calling gc explicitly !
|
|
|
|
|
Hi,
Thanks for the advice. We hope that there are no problems with the code and it is just a configuration issue. Just a doubt, where can I change the max working set?
Thanks,
rmga
|
|
|
|
|
I forgot to tell you, When the application is running in Windows 2003 and it reach 200Mb, the app stop performing the reflection dynamic execution.
This is beacause the app try to request for more memory but the OS doesn't give the requested memory. From that momment the app could't verify the state of the incoming transaction and reponse OK to everything. (This was developed to do that, When the app tries to create an object and couldnt achieve to get enough memory, it approve the transaction)
In Windows XP works fine and always achieve to free memory and re-use it to complete each evaluation.
rmga
|
|
|
|
|
So there must be a real problem then.
Did you call Dispose() on everything you create (either with keyword new,
or by calling a method that has Create in its name) that offers a Dispose()
method ?
I would recommend you add logging (preferably to a file), so you can
track the major events in your app; then compare the log sequence when things
go wrong with the sequence when things are still fine.
|
|
|
|
|
Hi,
I dont know, I trust you can somehow but I never needed it.
|
|
|
|
|
I have added a microsoft word 2003 reference to a program of mine.
I use C# .net visual studio 2005.
It all works fine.
I create a release and a dll file called Interop.Word.dll is created.
The release work fine on my computer but when i try it on another it doesn't work.
Do you know why?
Word exists on the other computer.
Is it because word doesn't exists at the same location on the other computer?
|
|
|
|
|
Did you copy Interop.Word.dll to the other computer, this is what lets it talk to Word? Is it the same version of word on the other computer? When you say it doesn't work, do you get an error? If so what is the error? If not what are the symptoms?
topcoderjax - Remember, Google is your friend.
|
|
|
|