Beginner working on a free-time project in C# needs help

Page 1 of 1 [ 1 post ] 

Death_of_Pathos
Deinonychus
Deinonychus

User avatar

Joined: 7 Nov 2008
Age: 37
Gender: Male
Posts: 351

19 May 2009, 2:32 am

What I am doing: I have an idea for a group of functions that people could simply add to their existing programs to let them determine what is represented at a given location on the screen (a form of OCR). It is (very near) optimized for identification speed. The primary use for it, that I see, would be in making bots or 3rd party tools for video games. That is not why I am doing this, though: I want to A) gain practical coding experience B) have something to put up on my website for prospective employers to examine.

What I have done so far: I started on this a while ago in AutoIt3 but gave up on it, in part because using nested arrays to emulate OOP was getting annoying (I was really near to completion, though). After (mistakenly) learning that C# has all the capabilities of au3 (notably, user i/o manipulation) I decided to switch to C# and use SQL to store the various stuff I need. I wrote out, on several pages of paper, exactly the flow of each function, the relation of each table, and what I could do to preempt certain problems (like how to avoid misidentification when all of a character's salient pixels exist as a subset of another character) and am now ready to start coding.

This is where my problem is: I have little C# experience. While I understand C++/python like console applications, scripting, HTML, and similar things I frankly find the C# IDE confusing and intimidating. I do own a book on C# and I have so far used that and a couple of web resources to 1) add a datagridview [using a preexisting database] 2) create my own tables in that database, 3) add a button with a working click event. However trying to do something as seemingly simple as making it so that when I click the button the source of the datagridview is changed to a different table has so far stumped me.

An unexpected hiccup: While writing this I noticed that the C# getpixel function was not what I thought it was - it only works on an image file, and can not be directly used to read from an arbitrary point on the screen. In order to do that you apparently need to take a screenshot then use getpixel on that. My question is will that notably slow down the process of identification? Could I take an image of only a certain part of the screen to speed it up?

What sort of help I anticipate would be most useful:
A) Some abstract of the gestalt purpose of all this s**t on the C# 2008 express edition IDE's screen - so I can take what I read in better context.
B) Are there any other languages that allow me to read pixels, simulate mouse/keyboard input, and work with memory?
C) How do I handle SQL queries from within a custom function - like say that I wanted to see if there are any rows in db_Pixel whose Group column is equal to (the output of another SQL) and whose Color column is set to 0xFF00FF, how would I go about actually coding that? A SELECT statement would just return a view (right?) and I cant use that in boolean comparison...
D) Why does my kickass computer lag in the C# IDE, even when task manager displays only trivial RAM/CPU uses by other programs?
E) Anything else that I know too little to ask. If need be I can type up all of my notes on the program.

When I try to program I feel like an author who has just thought of the best plot, but forgotten how to write... anything you can do to alleviate that would be so beneficial that I would instead be unable to explain my thanks. :)