|
Thanks for your attention.
Currently I am working on a image processing program for PPC (using C#), yet there are two problems remained to be solved:
1. Rotating an image. Compact framework doesn't support the methods such as "Image.RotateFlip" or "Graphics.DrawImage(Image, Point[])", so I need to implement the rotation function completely by manually coding. Therefore I need an algorithm, which doesn't invoke any special system-provided method, to perform image rotation.
2. Saving an image. The compact framework doesn't support the Image.Save method, so I have to find another way to save a Bitmap object into a JPEG file.
Any kind of help will be greatly appreciated. Thanks.
|
|
|
|
|
Answering your first question
There are some image processing libraries on CodeProject, try to look at their sources.
You can try to research CxImage [^], there is an implementation of image rotation. Or you can try this one [^], written on C#.
|
|
|
|
|
Hi,
I am trying to grab a video clip from a movie in C# using DirectShow. I am using DirectShowNet project which I got from codeproject.com.It is working well when i am using devices like web cam etc .
I am getting problem in playing a movie which is stored on hard disk and capturing video clip from it.
An Exception is raised when SetupGraph() function is invoked from
RenderStream() function "Invalid Parameter".
I had used FilterCategory.LegacyAmFilterCategory as first argument to
DsDev.GetDevicesOfCat() function.And from the list of devices displayed by DeviceSelector class I am selecting 'File Source(async)'
|
|
|
|
|
Hi guys and gals,
I have a windows form with a DateTimePicker and a DataGrid. What I would
like to do is double-click a cell in the DataGrid and have that cell
update to show the date that is selected by the DateTimePicker.
Any suggestions as to how I could do this?
TIA
Steve
Web design and hosting
http://www.kayess.com.au
|
|
|
|
|
Perhaps you could even embed the DateTimePicker in the DataColumn, so that whenever you click on a cell it drops down so that you can select a date and automatically updates itself. Have a look here[^].
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Thanks Polis, but that's not what the boss wants I'm afraid.
Web design and hosting
http://www.kayess.com.au
|
|
|
|
|
In that case, here's what I think.
1. First of all, in order for you to be able to handle the cell you click you have to get the current row by writing something like:
CurrencyManager <code>xCM</code>= (CurrencyManager)this.dataGrid2.BindingContext[this.dataGrid2.DataSource, this.dataGrid2.DataMember];
DataRowView <code>xDRV</code>= (DataRowView)xCM.Current;
DataRow <code>currRow</code>= xDRV.Row;
2. Then you move on by specifying that you wish to respond only to mouse-clicks that fall between a cell's range:
System.Drawing.Point <code>point</code>= new Point(e.X, e.Y);
DataGrid.HitTestInfo <code>info</code>= this.dataGrid2.HitTest(point);
if(info.Type == DataGrid.HitTestType.Cell)
{
currRow[myDataTable.Columns["Date"]] = this.dateTimePicker1.Value.ToShortDateString();
}
A piece of note here. In order to be able to get the your new point from e.X and e.Y, you will have to write the code in a relevant event (such as your dataGrid's mouseUp event)
Something important: The actual change will not take part on the dataGrid itself but on the DataRow of the table that the dataGrid is bound to. By changing the column of your bound table, the value on the dataGrid's cell will automatically change
Hope this pleases the boss
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Thank you Polis,
you are my hero
now if I do a
if(e.Clicks == 2)
in the MouseUp Event that will handle the
double-click.
Cheers
Steve
Web design and hosting
http://www.kayess.com.au
|
|
|
|
|
Glad I could help Steve
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Hi
I am sending some data from one win form application to a database in the remote machine through a web service running in the remote machine.
My requirement is first I have to find out that either the machine (Win form application running machine) is connected to the network or not?
If the machine is connected to the network I have to send the data to the remote machine else I have to store the data locally.
Could any one tell how to detect weather the web service is running in the remote machine or not?
Could any one through some inputs on this ?
Regards
Subbu.
|
|
|
|
|
The client proxy class will throw a WebException if it can't connect to the service.
|
|
|
|
|
Hi Dan Thanks for your reply.
|
|
|
|
|
Look at the following snippet of code. By pressing button1 invokes AddRow() method intending to add a row to the table (say Customers). When run it there won't be any erros but physically it hasn't added any row to the customers table. What's wrong with that. Anybody could suggest?
Thanks
***********************************************************************
public static void AddRow(DataTable myDataTable)
{
DataRow myNewDataRow = myDataTable.NewRow();
myNewDataRow["CustomerID"] = "T1Com";
myNewDataRow["CompanyName"]= "My Company Name";
myDataTable.Rows.Add(myNewDataRow);
myDataTable.AcceptChanges();
}
private void button2_Click(object sender, System.EventArgs e)
{
OleDbConnection conn = new OleDbConnection(@"provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Temp\orders.mdb;User ID=;Password=;");
string selectString = "SELECT CustomerID, CompanyName "+
"FROM Customers ";
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandText = selectString;
OleDbDataAdapter dAdapt = new OleDbDataAdapter();
dAdapt.SelectCommand = cmd;
DataSet dSet = new DataSet();
conn.Open();
dAdapt.Fill(dSet,"Customers");
DataTable dTable = dSet.Tables["Customers"];
AddRow(dTable);
conn.Close();
}
************************************************************************
|
|
|
|
|
Do you update your dataset with the new changes after you update the the "Customers" table?
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Thanks Polis. Not.
Because I feel AcceptChanges() method calls the UpDate() method.
However just now I added ** dAdapt.Update(dSet,"Customers"); ** statement into Button2_Click() function just after ** AddRow(dTable); **.
Now it looks like below.
AddRow(dTable);
dAdapt.Update(dSet,"Customers");
Still it is not writing to the table.
(Indeed I am using another way of inserting data to the table but wish to discuss and know why is it not working in this way.)
Thanks.
|
|
|
|
|
The thing is that the actual table "Customers" has nothing to do with the dataTable dTable that you created. The dTable is just an object that you create in memory to hold the information of the "Customers" table. By adding a new row in it, it does not mean that you add a new row into your actual physically stored "Customers" table.
In your code, currently you add a new row into your dataTable object but you still update the dataAdapter with the "Customers" which is unchanged (since the new row was added in the dTable).
One way to achieve what I mean is:
1. Keep the addition of the new row into the dataTable dTable
2. Copy the dTable info back to the "customers" table
3. Update your dataset
Hope this helps
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
|
Ur welcome
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Hey!
I added an "AxWebBrowser" component to my form.
when I built the form everything was great, but pretty much useless.
so now I want to make my AxWebBrowser object navigate, so I added this method:
this.axWebBrowser1.Navigate("http://www.codeproject.com");
and I got the "InvalidActiveXStateException" Exception.
I really searched the web for a solution, but everything I found didn't work!
I don't underststand why it happens, and more than that, how to solve it.
can anyone help me with this???
|
|
|
|
|
Do u know about any software can edit assembly files(.exe,.dll)?
Nothing
|
|
|
|
|
Hi,
I looking for create dynamically some control in a form with the possibility of moving each control anywhere in the form.
I would like to store the position and store it to a xml files.
After create some config, I would like to restore a specific config.
My question is :
How can I moving each control create dynamicaly with the mouse ?
How can I retrieve the position of each control in the form ?
Best Regards
youssef
|
|
|
|
|
In the class level :
Point p = new Point(this.button1.Location.X,this.button1.Location.Y);
In the mouse down event :
void form1_mousedown()
{
//Write some code to add the point p to the config file ,Ican't remember how right now.
this.p = new Point(-e.X,-e.Y);
}
In the mouse move event :
void form1_mousemove()
{
if (e.Button == MouseButtons.Left)
{
Point mousepos = Control.MousePosition;
mousepos.Offset(this.p.X,this.p.Y);
this.button1.Location = mousepos;
}
}
|
|
|
|
|
How to suspend drawing operation of a form while a block of operations is done ?
For example I need to draw some things on the form and to move some controls so that the form doesn't repaint after each of them was moved.
|
|
|
|
|
I'll give this a shot but a .NET guru might be able to point out a fatal flaw in my case, but here goes.
I know for sure that we could do something like this with streight WinAPI stuff but how will .NET controls handle it. Who knows.
Anyway the theory works like this. The message pump for your application is dispatching messages to all of your windows and controls. Just disable the pump, do your thing with the controls (in a non-gui thread) but be carefull not to use any blocking calls that rely on a message back (the pump is off now remember), then when you are all done, turn the pump back on and issue a WM_PAINT. I've done similar things in C++ using the WinAPI without hitches (usually). Also note that the manipilation of the controls is being done in a NON-GUI thread but I think that as long as you are carefull about what you are doing to those controls, you should be alright. Be quick though because I believe windows sends some kind of a heartbeat message every so often and if it detects that your pump is down, it'll pop up a dialog saying your app has stopped responding. Not sure the mechanism winsdows is using for this but i suspect it's using a WM_NCPAINT to detect this somehow.
Not sure how to turn the pump (message dispatcher) off in .NET application but I assume it's probably pretty easy.
*** NOTE
I assume that the controls you try to move about the form are issuing an Invalidate which causes the main form and the control to receive a WM_PAINT... Make sure you are not issuing and Invalidate or a refresh anywhere in your code that moves these around until you are all done.
Probably not too much help but it'll give you a starting point.
.NET GUI gurus, any ideas? Will this blow up in his face in .NET?
|
|
|
|
|
Yes, I have done it like this.
Maybe there is a certain function in .NET that makes the same , but in an easier way.
Something like:
BeginUpdate();
.... some code here ...
EndUpdate();
Between these 2 tags the controls are not repainted.
Now I have made it through message filtering, i.e. I have a variable , which when set TRUE, paint messages are not allowed to be dispatched to controls contained in the form.
Works well.
|
|
|
|