|
Hi,
Yeah here we are facing problem into rotation of image but this is in totally reverse process,here i am describing the situation.
I know how to rotate the image after getting the theta (i.e. rotation angle)
but here we are having requirement that we have one standard (0,0) co-ordinate on left top of the page and image is on any part of that page and now we want to find out that exactly on which location and on which angle should we rotate and traslate image by which output is that we got image on the (0,0) co-ordinate of the page.
thanks,
regards,
montu3377
|
|
|
|
|
I don't know if you're manually coding the rotation algorithms by yourself or if you're using GDI+ features. If using GDI+, you can simply combine calls to TranslateTransform and RotateTransform methods before drawing to the Graphics object to achieve what you described.
Yes, even I am blogging now!
|
|
|
|
|
Hi,
great.Yeah becoz here we are concen more about performance.I don't know wherether after using GDI+ gives better performance or slow performance in rotation and translation of image.
Present situtaion is that in first phase we are finding co-ordinate of each and every co-ordinate starting from (0,0) and then storing into array and then we findout three co-ordinate of L shape by which we defined rectangle location and then we will find out rotation factor and transformation factor so this is our plan.We required better option then this one.We are also concern about our performance so is our plan works or if not please suggest some good one if you have some other plan in urs mind.
thanks,
regards,
montu3377
|
|
|
|
|
montu3377 wrote:
great.Yeah becoz here we are concen more about performance.I don't know wherether after using GDI+ gives better performance or slow performance in rotation and translation of image.
As a design principle, I start my coding using standard libraries as much as possible. Only after I have something working, I start optimizing it. It's simpler that way, because, once you have something working, you can measure it and optimize the most time consuming tasks.
GDI+ is fast, very fast, but not the fastest thing possible. Very often, GDI+ will be faster than anything you'll write, because it was written by experts at image manipulation on MS.
Here, on CP, you can find some articles that describe how to do high-performance and/or high quality image rotation, but I'd suggest you to first try GDI+ and see if image rotation is really what you need to optimize.
I can't stress enough how important is measuring. If image rotation takes only 1% of the time of your application, and you double its speed (and this kind of optimization is hard to do and time-consuming) you'll only have a 0.5% gain on your application.
Yes, even I am blogging now!
|
|
|
|
|
HI,
yeah thank for your very nice information.
some another thing i have to ask to you.Suppose i m having three co-ordianate with me say (x0,y0),(x1,y1) and (x2,y2) and now i want find out rotaion angle (theta) and transformation factor but how can i start some sort of code what is the way to convert matrix from co-ordinate becoz
here we are having formula.
public void TranslateTransformAngleMatrixOrder(PaintEventArgs e)
{
// Set world transform of graphics object to rotate.
e.Graphics.RotateTransform(30.0F);
// Then to translate, appending to world transform.
e.Graphics.TranslateTransform(100.0F, 0.0F, MatrixOrder.Append);
// Draw rotated, translated ellipse to screen.
e.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);
}
now suppose i m having 3 co-ordinate then how can i use this above method into my code.can you explane some sort of code if possible.
thanks.
regards,
montu3377
|
|
|
|
|
I`m using hierarchical flexgrid, but couldn`t set the number of columns. I recently using vb
with the hierarchical flexgrid and set the number of column with flexgrid.cols. While using c#
I tried using set_cols(didn`t work), what is the bandNumber properties on that parameter? How can I set the number of column corectly.?
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
Has anyone worked on programming to capture live video on an IP camera? I am working on a project to capture live video and transmitting it to another pc and save them.
Thanks
kimlye
|
|
|
|
|
A quick search on "web cam" on this site turned up several results[^] that you may find interesting. This site is comprised of both articles and a forum, both of which are searchable.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
I have developed the application uses SQL command (Usesing 'System.Data.OleDb') to update a record in MS Access XP. There is one field in MS Access has Yes/No type.
I try some SQL in C# but catch error: Systax error UPDATE, INSERT clause.
When I copy this code from C# into SQL environment of MS Access then no error.
Would you show me SQL command in C# to INSERT, UPDATE into tables have some field Yes/No in MS Access.
Thanks for your help.
|
|
|
|
|
Hi!
Using true and false instead of Yes and No should work, IIRC.
Regards,
mav
|
|
|
|
|
It's a boolean type, and you treat it as such. Using parameterized queries (and never use string concatenation, unless you like getting 0wned by SQL injection attacks):
OleDbCommand cmd = connection.CreateCommand();
cmd.CommandText = "INSERT INTO MyTable (BoolParam1) VALUES(?)";
cmd.Parameters.Add("BoolParam1", OleDbType.Boolean).Value = true;
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
|
I am trying to write a web service in c# which will be accepting SOAP calls from a web application and then perform a data call using modem, retrieve data and pass that data back to the web application.
How do I handle cases where I have multiple SOAP calls and only 2 modems to call from? I would like to not have any SOAP requests dropped but rather queued and processed as soon as the modems are free. How do I detect which modems exist and how many are free?
Regards
parrot123
|
|
|
|
|
You could create a singleton object that manages a pool of modems (make it configurable in case you need to add more later).
The biggest problem you're going to face is timeouts, however. The default timeout - configurable for both ASP.NET and IIS (see the <httpRuntime> configuration section for how to control this in ASP.NET) - is 30 seconds. That's about how long it takes modems to establish a connection, nevermind downloading data. Waiting on a small pool of modems means the timeout from a client for a web service call is going to be greater.
You might consider .NET Remoting over a TcpChannel that is not hosted by IIS (if you host a .NET Remoting objects on IIS - whether or not you use a TcpChannel - an HttpChannel is used instead and HTTP is a one-way protocol by nature). You could define an event that the client would handle. Of course this is asynchronous, which may not fit your requirements.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thanks for this
Do you mean writing a tcp server accepting calls from the web application and responding back to it once it has completed communication with the modems? Does that also mean that ASP will have to initiate a tcp connection with the server and send a request rather than making a SOAP call to a web service?
I have no experience with singletons and very limited experience in .Net programming of serial ports, but have written a vb6 application that performs what i want to do exactly (i.e. calls the modem and gets the data)--is there a way I can use that?
Thanks again for your help
|
|
|
|
|
How do you populate a filelistbox?
|
|
|
|
|
There is no FileListBox class in .NET. Please be more specific about what you mean.
If you want to fill a ListView with files, then create an instance of the ListView class, set whatever properties you want on it (like ListView.View = View.Details for a columnar view), and enumerate files within a directory.
You can do that using the DirectoryInfo class, which you instantiate with a given directory path, then call GetFiles to enumerate the files, each of which will be referenced by a FileInfo class (along with their attributes, sizes, etc.).
If you search or browse this site's articles you can find several examples of enumerating files and displaying them in a myriad of controls including the ListView control.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
There is a FileListBox control. I had to go into Tools>Customize Toolbox menu, and then under the .Net Framework Components tab.
Or am I totally mistaken? Actually I think I am, I see now that it's namespace was Microsoft.VisualBasic.Compatibilit.VB6. Does this mean it's not usable?
If so I'll just do as you said and search on enumerating a ListView with the files.
Thanks for the help.
|
|
|
|
|
It's not a control in the BCL (base class library). The Microsoft.VisualBasic.Compatibility.dll assembly that defines the classes in that namespace is an assembly. Remember that VB6 and VB.NET are two completely different runtimes, sharing only syntax for most of the language. The compatibility assemblies are only so that you can easily migrate your codebase from VB6 to VB.NET.
You should use the ListView , though, if you can. This eliminates a dependency on an extra assembly for minimal purposes. If you search this message board (see "Search comments" above) for SHGetFileInfo you can even find a post I wrote some time back (it may be referenced multiple times) that can get you the icons for files, whether or not they actually exist on the filesystem (though, if they do exist on the filesystem you want to call SHGetFileInfo a little differently in order to get the proper icons for extensions with special icon and icon overlay handlers, like .xml files).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I'm not to much concerned about the info on each file. I'm going to do more research on you previous post about just enumerating a ListView with DirectoryInfo Class and GetFiles.
Thank you for the help.
17 year old with too much free time.
...cooler than the other side of the pillow.
|
|
|
|
|
Update:
Just got my ListView populated with all the files from a specified directory. I ended up piecing most of the code together from MSDN examples.
Now just to filter the files and figure out a clever way of setting the directory from which to pull the files. But that's neither here nor there.
Thanks for the help!!
17 years old with too much free time.
...cooler than the other side of the pillow.
|
|
|
|
|
Could any one tell me how to maximize a form within a web project in C#?
I cannot find a direct way to do this unless it is a traditional Windows application where you simply code something like "MyForm.Maximize = true;".
Thanks.
William
|
|
|
|
|
Because you're working within a web page and are subject to the object model exposed by the browser (and you're limited in what you can do anyway). You can either add some client-side JavaScript to the page that uses the screen object or open a popup window using window.open that specifies the initial settings (which you get from the screen object). All major browsers expose such an object (it is part of the HTML DOM, after all).
If you need additional help, please ask in the Web Development[^] forum. With client-side scripting, this has nothing to do with C# (which is a managed language you would find either in an ASP.NET server application that simply constructs client-side HTML, JavaScript, images, etc.) or in a Windows Forms control to be hosted in an HTML page (like an ActiveX control).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hello,
I have been looking for the answer for this but haven't seen anything clear.
I am new to c# and want to create a sorted list (or a collection with key/object) with the key as a string and the second element a class object that i have created. But this doesn't seem to work directly (I'm used to STL in c++).
It appears I have to do some work with this class object. Can someone point me to a place where this is properly described?
Thanks in advance, jb
===================================
jonathan borden
jrborden@austin.rr.com
|
|
|
|
|