|
Good day
I'm having a problem with the writer.Open() method in the AForge library.
I've tried running Andrew Kirillov's code snippet (below) from his "Motion Detection Algorithms" article, on how to save video to a file, but when I attempt recording the program it jumps right into the exception (since "writer.Open()" isn't working).
SaveFileDialog sfd = new SaveFileDialog( );
if ( sfd.ShowDialog( ) == DialogResult.OK )
{
AVIWriter writer = new AVIWriter( "wmv3" );
try
{
writer.Open( sfd.FileName, 320, 240 );
Bitmap bmp = new Bitmap( 320, 240, PixelFormat.Format24bppRgb );
for ( int i = 0; i < 100; i++ )
{
bmp.SetPixel( i, i, Color.FromArgb( i, 0, 255 - i ) );
writer.AddFrame( bmp );
}
bmp.Dispose( );
}
catch ( ApplicationException ex )
{
}
writer.Dispose( );
}
When I removed the catch() at the bottom, I got a "Exception unhandled: Failed creating compressed stream" message
Can anyone please help me identify the problem so I can fix it.
I've tried running the entire source code, but opening and saving video doesn't work there either.
tvb
|
|
|
|
|
Sorry, my mistake
See writing below code on Andrew's article
"Note: In this small sample and in the demo application I was using Windows Media Video 9 VCM codec."
Installed the codec and it fixed the problem
tvb
|
|
|
|
|
Hi,
two comments:
1.
removing a try-catch structure is not the way to get anything solved.
2.
having an empty catch block is a deadly sin. What you should do is display the exception you got,
as in Console.WriteLine(exc.ToString()); as that would give you valuable information.
An empty catch block just swallows the exception, hence it hides the problem without solving it.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
oh thanks, but I actually only removed it temporarily (i.e. try + catch) to see where the program crashed.
Then stepped through the debugging to see where this happend
But thanks, will keep the console.writeline in mind
tvb
|
|
|
|
|
hi
i am working on a web application that automates the web site. it automatically logins after login it wents to the next page but at that next page i want to click a link but the navigator still sees for the first page and gives error" object reference not set to an instance of an object". so plz look into the matter.
|
|
|
|
|
T_Teef wrote: object reference not set to an instance of an object
Something is null. Debug the code and find it.
|
|
|
|
|
i know some thing is null because it is not able to find that link on the next page it is still looking on the same page. so now what should i do.
|
|
|
|
|
hi
why does this fonction don't retrieve the same result as Graphics.MeasureString ?
public RectangleF MeasureString (string str,Font f)
{
using (GraphicsPath gp = new GraphicsPath())
{
gp.AddString(str,f.FontFamily,(int)f.Style,(300 / 72) * f.Size,new Point(0,0),new StringFormat()); // i'm using 300 dpi
return gp.GetBounds();
}
}
|
|
|
|
|
try to change the value of this
e.Graphics.PageUnit = ?
I know nothing , I know nothing ...
|
|
|
|
|
i need to develop my own application with user name and password which allow users to login to windows.....how can i do tha....pl guide me on this......
thanks
A S E L A
|
|
|
|
|
So you want an application that runs before the user logs in to windows and replaces the standard windows login functionality?!?!?
|
|
|
|
|
ya that's what i want to do...
A S E L A
|
|
|
|
|
The mere fact that you're asking this question at all says that you don't have the skills to pull it off. It cannot be done in C#. For Windows XP, you have to write an entirely new GINA. For Vista and above, you need to write a new Credential Security Service Provider.
|
|
|
|
|
Amusingly, I told him this a day ago. This guy is just a retard, he asks the same things over and over, and ignores the answers.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
That sounds suspiciously like a virus to me. However, you should look into replacing the MSGINA process
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
no it's not a virus.....this is my major project last part...i have developed a QR barcode decoder with a webcam. that mean user show the barcode to web cam and take picture of the barcode. then decode the barcode. so im going to do is pass that barcode string as the user password and user name will take from system automatically. so one user show the barcode and press button if it is a valid barcode and match the string with windows password system will log in automatically. so user don't have to type the password. only need to show the barcode and click on login button....
that's what im trying to do.....i got my decoder and can get the string smoothly...only thing i have to do is this windows loging part
....
please anyone guide me on this.....\
thanks for you all/....
A S E L A
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|
|
What the hell is wrong with you ? I answered this yesterday. There is no other answer.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I need some advice!
First, I work in a testing center and in my spare time I am trying to write a c# program that allows us to see all the computers, highlight them and shut them down, turn them on etc.
I had originally thought that list view would be a great approach since it handles multi select, and provides an interface similar to explorer. I have one problem We have about 35 computers, and when I put them in the list view under large or small icon view, their is about 20-30 pixels of dead wasted space between each computer, this makes the form large and cumbersome.
Here are my questions.
How can I change the spacing in Large or Small Icon view so they are closer together vertically? (my icons/images are 32x32)
Or can anyone suggest an alternative control or method to dynamically at runtime be able to add computers, and be able to multi select?
Thanks
Travis
|
|
|
|
|
How about changing the View property of ListView to List?
IMO ListBox would also be a decent control to use.
|
|
|
|
|
We would like to arrange the icons how they show up in the lab, i.e. in rows and columns. any ideas?
|
|
|
|
|
Try flowLayoutPanel
I know nothing , I know nothing ...
|
|
|
|
|
That would not give me the control over rows and columns that I would like, I have thought about a table layout, and while that would work, it does not give me native multi select, which I guess I would have to program manually.
I would love to make viewlist work, I just need to figure out how to make the columns and rows smaller without making the image smaller so there is not as much wasted space.
|
|
|
|
|
If no one has any ideas, anyone know a good place to read tutorials on building good custom controls?maybe I can mix something up.
|
|
|
|
|
Anyone knows what happened to BufferManager class?
I am not able to get this with a windows form application (fails on compilation saying the class cannot be found).
I see that this class should be in System.ServiceModel.Channels (per the VS 2008 .net FW 3.5), but this namespace does not exist (no ServiceModel in System).
I am using VS 2008, not sure about .net FW version.
|
|
|
|