|
The core answer here is that if you want to do any sort of drawing, you should just draw directly on the form, in almost all cases. As Pete said, my image processing articles do offer a library you can free use for things like blur. Because I was trying to illustrate some core concepts with my code, I never use color matrixes, which are almost certainly a faster option for things like greyscale. You might want to also check out the source for the fotovision sample ( or paint.net ) to see if they do things in a way that's more optimised than my articles, which are designed around teaching how to write certain types of generic filter and then how to do different effects within that framework.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
DOes anyone know a way of checking collision between a picturebox? I found a way, but I deleted it because it worked only sometime, and other let the object pass right through. I used (Something like this...)
private void CheckCollision()<br />
{<br />
int x = picturebox1.Location.X;<br />
int y = picturebox1.Location.Y;<br />
int ex = picturebox2.Location.X;<br />
int ey = picturebox.Location.Y;<br />
<br />
<br />
if ((x + 20) == ex<br />
&&
||
this.Close();<br />
<br />
}
So, my real question (I was just showing you basically the idea I had), is if there's a simpler way to do this. Thanks in advance.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Look at the picturebox1.Bounds.IntersectsWith() function.
Here's an example I made long time ago:
if (pictureBox1.Bounds.IntersectsWith(pictureBox2.Bounds))
{
MessageBox.Show("Collision!");
}
Virtual1ty "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
It's so easy! I mean, really, even for squares/rectangles, it's easy! Thanks a lot.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
You're welcome
Virtual1ty "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
Do you know anything about my post above??? ^ ^ ^
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Your first post?
Virtual1ty "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
"Paint.NET"
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Sorry, I don't
Virtual1ty "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
Thanks anyways.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
i am not sure if i am on right site. i am wondering if you can help me. i am seeking some
carrer advice/guidance from you.
i use to work in totally different industry than IT. two month
ago i have resigned my job and made up my mind to jump in to IT industry, cos i was really
bored with my previous job. so i have started studies C# lang. as i have never done
programming before. it is quite challenging for me. i m not attending any class room
course/coaching, only studying at home, cos canot afford course in UK.
As i m studying C#, i am almost at stage of finishing my book and i find it interesting.
with that i have lots of question flowing in my head. it will be great , if u could give
me guidiance on following :
1. i m alomost there to finish my book, but i just wonder there is so many concept in it
and how m gonna join all together to make software or program
2. is it possible i can pratice C# langauge , if yes then how? like through books ,
dummies project or pratice software and where can i get these stuff from which is suitable
for fresher/new commer not for people who is allready in developing software. as i m not
taking any coaching i dont have lab sessions.
3. how can i prepare myself for interview or what kind of question they ask, and how whole
interview process run?
4. should i studying any additional material to go with c#, which will help me getting job
easily in UK or which better for my carrer.
i m so soory to ask so many question bcos i am so confuse and i have no one else to ask
apart from using internet. thanks for reading my mail. i will appriciate if you could
help.
many thanks
sid
|
|
|
|
|
Hi welcome to CodeProject.
Can I start by pointing out that this is not the right forum for this sort of question, it would be better suited to somewhere like General Discussion or Work Issues. This forum is for specific programming questions with the C#language.
sid_si wrote: i m alomost there to finish my book, but i just wonder there is so many concept in it
and how m gonna join all together to make software or program
This is almost impossible to answer other than to say that the more you practice the individual concepts the more they click into place as a whole. Read Books, download examples, learn from others.
sid_si wrote: is it possible i can pratice C# langauge , if yes then how?
Microsoft provide "Express Editions" of the Visual Studio progrramming environments which are free. Search for the one that is most suitable for you.
sid_si wrote: how can i prepare myself for interview or what kind of question they ask, and how whole
interview process run?
The same way as you would prepare for any interview; learn a little about the company, and what sort of person they are after. Learn what technologies they are using and what products they provide.
As far as the interview process goes, most programming jobs have a normal interview followed by one or more technical "tests" or interviews. Do not attempt to bullshit this part as you will find yourself in a job that you have no idea how to do which will rapidly lead to you being out of a job!
sid_si wrote: should i studying any additional material to go with c#, which will help me getting job
easily in UK or which better for my carrer.
Frankly if all you know is C# then you are unlikely to get a job. GO and have a look on monster.com at jobs advertising for C# (or .NET) developers and see the list of other skills that employers are looking for.
Apart from that programmers are problem solvers. If you have a good brain for figuring out puzzles and like logic problems then thats a damn good start. Another thing that is vital is the ability to search for the answers to things. Which means that all the questions you have asked above can be answered by a bit of research on your part.
Finally one thing that ALL employers in ALL fields are looking for is a good literate person who can communicate well. I suggest you get out of the habbit of the over use of words like "bcoz" and "ur" as well as touching up your general spelling.
Good luck.
|
|
|
|
|
|
OleDbConnection m_Connection = new OleDbConnection();
m_Connection.ConnectionString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:user.mdb";
m_Connection.Open();
//m_Connection.Close();
Can any one tell me that how could i write edit command using this db
|
|
|
|
|
Essentially you have four things you can do: SELECT, INSERT, UPDATE and DELETE. When you edit a record you first SELECT the record, make changes then use UPDATE to save the changes to the database. Go to msdn.com and click the Library link, search for OleDbDataAdapter. Here's an example from...
<br />
public DataSet CreateCmdsAndUpdate(DataSet myDataSet,string myConnection,string mySelectQuery,string myTableName) <br />
{<br />
OleDbConnection myConn = new OleDbConnection(myConnection);<br />
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter();<br />
myDataAdapter.SelectCommand = new OleDbCommand(mySelectQuery, myConn);<br />
OleDbCommandBuilder custCB = new OleDbCommandBuilder(myDataAdapter);<br />
<br />
myConn.Open();<br />
<br />
DataSet custDS = new DataSet();<br />
myDataAdapter.Fill(custDS);<br />
<br />
<br />
myDataAdapter.Update(custDS, myTableName);<br />
<br />
myConn.Close();<br />
<br />
return custDS;<br />
}<br />
|
|
|
|
|
System.Data.OleDB.OleDBConnection();// OleConn;
System.Data.OleDB.OleDBConnection OleConn;
"Provider=Microsoft.Jet.OLEDB.4.0; Data source=C:\tony.mdb";
OleConn.Open();
the following code is giving error
OleDB namespace not exist??
please tell how to tackle that error and how to acess the database
|
|
|
|
|
The code should be:
System.Data.OleDb.OleDbConnection OleConn = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data source=C:\tony.mdb");
OleConn.Open();
|
|
|
|
|
I've found this, potentially, useful code example on the Interweb:
delegate object WorkDelegate(string arg);
public object DoWork(string arg)
{
WorkDelegate d = new WorkDelegate(DoWorkHandler);
IAsyncResult res = d.BeginInvoke(arg,null,null);
if(res.IsCompleted == false)
{
res.AsyncWaitHandle.WaitOne(10000,false);
if(res.IsCompleted == false)
throw new ApplicationException("Timeout");
}
return d.EndInvoke((AsyncResult)res);
}
private object DoWorkHandler(string arg)
{
Thread.Sleep(5000);
return "blah " + arg;
}
From here: http://www.developerfusion.co.uk/show/4497/[^]
The intent is to allow a synchronous method to timeout - I'd like to use this as I have to make a call to a barcode scanner api, which has no built in timeout and is prone to hanging/crashing/locking up my application when it fails.
Can any of the more experienced denizens of this handy forum spot any problems with it? Is there a huge "gotcha!" anywhere?
Me: Can you see the "up" arrow?
User:Errr...ummm....no.
Me: Can you see an arrow that points upwards?
User: Oh yes, I see it now!
-Excerpt from a support call taken by me, 08/31/2007
|
|
|
|
|
This may return control to the caller of DoWork after the timeout, but it does not stop the DoWorkHandler from executing. The BeginInvoke is going to execute on a thread from the ThreadPool. If you have lots of orphaned DoWorkHandlers running, then you could tie up all the threads available from the pool. There are some classes in the .Net framework that use the thread pool. So you may see other problems, if they are starved for ThreadPool threads. Your best bet is to timeout in DoWorkHandler.
Also, the timeout exception should use this[^].
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
HI,
can i insert controls into a ToolTip?
can i Change it appreance (color,Make it look like aballon, etc)?
THNAKS
kobkob
|
|
|
|
|
|
how to get the local system's ip address any method vailable..to get it programatically
|
|
|
|
|
Don't double post
Paul Marfleet
|
|
|
|
|
thatz sry any am increasing de chance of getting answered
|
|
|
|
|
Double-posting your questions is considered rude. People will notice and probably ignore both posts.
Consider carefully which forum is most appropriate for your question and post there. If someone wants to help you, they will do so. Double-posting only decreases your chances of getting help.
Paul Marfleet
|
|
|
|