|
We are working with a web-cam, which sends us frames (photos).
We want to turn these frames into a live video, to be watched from an ASP.NET web application.
What is the best way to do so using c-sharp?
|
|
|
|
|
Why, when so many solutions already exist? You don't need to assembly the frames in C# to be used in an ASP.NET web application. For example, some software will create MPEGs from frames and provide you with a URL that you can use with an embedded player (like Windows Media Player, QuickTime, RealPlayer , etc.).
If you insist on rewriting what's already been done a thousand times, you can assembly these frames in an AVI - an uncompressed (traditionally) video format. There is an article about this here on CodeProject: http://www.codeproject.com/csharp/steganodotnet4.asp[^].
If you want to encode this as something else, I recommend you look at Managed DirectX 9.0b (http://msdn.microsoft.com/directx[^]), which lets you easily enough pass the AVI through compressors. There are other ways, too, but again this type of software has already been written countless times.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Use this powerful control:
http://www.banasoft.net/AVPhone.htm
|
|
|
|
|
can a singleton remoteObj serve multiple(many) clients?
or should I use singlecall? (which gives me life span problem).
|
|
|
|
|
Yes. It is the single instance of an object. Because of this reason, make sure you lock any shared resources in your implementation using the lock statement (compiles to use a Monitor ) or a similar locking mechanism (mutexes, etc.), which you can find in the System.Threading namespace.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i want to set the textbox = ""
|
|
|
|
|
This belongs in the ASP.NET forum, but anyway...
Enumerate a Page 's Controls collection property:
foreach (Control c in Controls)
if (c is TextBox)
((TextBox)c).Text = ""; This is pretty much the same as what you'd do in Windows Forms.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i tell my friends you are my mentor i owe you so much i am writting a web app as well as windows app and loving it. my c# is growing every day thanks to you.
|
|
|
|
|
I've designed a form with a left and right section divided by a splitter component. in the left i've inserted a treeview component and on the right a panel with edits showing the data of the selected node in the tree.
I've seen that if i select a node and then focus on an edit control, in the tree the selection disappears.
Is there a property of a workaround to having always visible the selected item? In MFC when you use splitters, the splitted areas are standalone windows with their own focus handling.
|
|
|
|
|
See the documentation for the TreeView.HideSelection property in the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Is it possible for a ListView to contain SubLists (Kinda like a TreeList, but with more than one item)
For example:
+ TopItem1
+ TopItem2
- TopItem3
|_ ChildItem1 ChildItem2 ChildItem3
|_ ChildItem1 ChildItem2 ChildItem3
+ TopItem4
And you would be able to expand like shown above.
I hope to read your input soon.
Thanks in advance,
Jon
|
|
|
|
|
There is a reason why they are called ListView and TreeView!
You could come up with something like this, but you would have to draw the ListView control yourself. You can look at this[^] article by Jon Rista, here on CodeProject, for a start or just use his control...
RageInTheMachine9532
|
|
|
|
|
What would you suggest I should use to get the same effect?
I don't want to spend too much time on this since I have a lot more left to do, and my deadline is approaching fast.
The look i'm trying to achieve is something like this
www.microsoft.com/money/support/manual/screens/fig7-4.jpg[^]
If you look at the table in the center of the application, you will see what I'm trying to do.
|
|
|
|
|
|
That's for ASP.NET.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Then you'll need to buy a commercial version. This type of control is difficult to do correctly and requires a pretty good working knowledge of .NET, object-oriented programming, collections, etc.
There are several available that aren't very expensive, like XtraGrid[^], WinGrid[^], and more.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you for your comments, I decided to keep my layout a little simpler for the time being.
It still has the same functionality, although its not as pretty
Thanks again.
|
|
|
|
|
I have a C# Windows Form that contains the logic to display an icon in the systray. I have that form hidden (visible = false). When the user clicks the systray icon I unhide the form (visible = true) to allow the user to change some settings. When the user finishes changing the settings he can click the close button (the X in the top right corner).
In the frm.closing event I have this:
this.Visible = false;
e.Cancel = true;
That code will hide the form for later use and it keeps the application from exiting.
Life is good UNTIL the user goes to shutdown the computer. During the shutdown process Windows goes to close my application; but my app sends Windows the Cancel signal and so Windows never shuts down. I’m about ready to hack something up with WndProc but I was hoping there might be some way to tell if whether my app is being closed by Windows or by a click of the close button (the X in the top right corner).
Thanks.
|
|
|
|
|
Implement the IMessageFilter interface and add an instance of your implementation using Application.AddMessageFilter (this can degrade performance severely if not implemented correctly / efficiently). Watch for the WM_QUERYENDSESSION (0x0011, cancelable) or WM_ENDSESSION (0x0016).
Alternatively, you can override WndProc in your main application window (the form you pass to Application.Run , for example) and do the same thing.
Windows sends this message when shutting down. You can return false to attempt to prevent Windows from shutting down (it most likely will), or just return true and close your application or do whatever you need to.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hai,
No matter wether it is a static data member or static member function. i need to access to and fro. to me it is not possible to access a static datamember or static member function to instance data member or member function.
But right now i want to do like that.
Any trick is there in your hand
hai, feel free to contact
Sreejith SS Nair
|
|
|
|
|
Which, of the potentially millions, of instances would you like to access?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event
|
|
|
|
|
What? Can you try explaining a little better?
To access a static member, first make sure the access modifier allows it. It should be public for all code to access it, protected for derivative classes to access it, internal for code in the same assembly to access it, and protected internal for code in the same assembly or derivative code in any assembly to access it. If you're not specifying an access modifier, than members default to private.
Then, just access the member using the Type - not the instance:
MyClass.MyStaticMethod(); If you're calling a static method or getting/setting a static field or property in defined on the same class in which your code is currently executing, you don't have to specify the class name, though I personally find it easier to read.
If you're trying to access instance data through a static member (bad idea), then your instance must get/set itself as a static member like so:
public class MyClass
{
private static object syncRoot = new object();
public MyClass()
{
if (theInstance == null)
lock (syncRoot)
if (theInstance == null)
theInstance = this;
}
private static MyClass theInstance;
public static MyClass TheInstance
{
get { return theInstance; }
}
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Or the instance could pass itself as a parameter to a static method, but there's no reason to do that instead of creating an instance method. I'm interested to see more information from the poster.
Regards,
Jeff Varszegi
EEEP!
|
|
|
|
|
By definition, no you can't use a Static member to access instance data. Reason being, static members are not associated with ANY instance. They can be used without instantiating an object from the class. Since they are never instantiated, they are also never associated with any other instance and, therefore, can't access instance data.
RageInTheMachine9532
|
|
|
|
|
... unless, that is, there's a static handle to an instance. This question smacks so much of misguided design that I'm interested to see more information from the poster.
Regards,
Jeff Varszegi
EEEP!
|
|
|
|