|
Is there a way to add a reference from Paint.NET or something that allows me to change the properties of a picture in a picturebox? What I mean, for example, is to have pictureBox1 and int x . The example being, based on the value of x, (x could be controlled by a timer; just an example...), the pictures motion blur would raise or drop. I know this sounds like a hard concept for a beginner, but in Paint.NET there's a simple way to change it, so I figured there might be a way in C#, without exceeding memory standards... Thanks in advance.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
You might want to consider WPF. It has a steeper learning code than WinForm (not surprisingly as WinForm is just an object oriented wrapper on a 20 year old technology that should have been replaced ages ago) but then things like this becomes trivial. Actually so trival code isn't really required - it can be done in XAML markup).
Example effects[^]
Don't mind it's a button being blured, it obviously does not matter if you apply the effect to an image, a button, a treeview, or whatever you like.
You can make individual controls in WPF and host them in WinForm applications - I tend to do this with my old projects when I can see it's easier to do a user control in WPF than in WinForm.
|
|
|
|
|
It's .NET 3.0. You will need some CTP plugins to Visual Studio 2005, or the beta release of VS2008.
While it is pretty new, the plans for it are not. There is a reason the temporary WinForm hack was stuffed into the System.Windows.WinForm namespace - it left the main namespace System.Windows free for WPF.
|
|
|
|
|
Thanks; do you know anything else, I mean, simpler, (I'm fairly new), with no downloads or anything, just a ref or something?
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Nope, sorry.
Maybe being new to this is just more of a reason to go to WPF. I have been using WinForm since the betas of .NET 1.0 and unlearning the stupidity and completely outdated methodology of it is a challenge.
|
|
|
|
|
Have a read of Christian Graus' here on CodeProject about graphics and GDI+. He goes into the theory of how to do effects based graphical stuff in C#. They are very good.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hey, thanks. Do I just look at his articles?
The most knowledge doesn't mean the most wise...
|
|
|
|
|
He has source code and samples that you can download and try. Plus, he explains why he has done things the way that he has. Here's[^] the link to follow.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
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();
|
|
|
|