|
Hi All,
I want to developed application for automatically detecting Video format .can any one help regrding above problem.Pls do reply on frum or personally mail me .
Thanks & Regards,
Amit More
amit.more@pictureal.net
|
|
|
|
|
Reading the FOURCC-code from the header of the video will you give you a lot of information. You can then use a lookup-table to check agains the correct format.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I've created an application that use panels with image inside. i use these panels as custom buttons or just for graphic.
When the application start and these controls are drawed it appear for a bit black (during on paint event) then are drawed, it happen also if i use normal textbox xp style, they are black then became normal when the application is ended to load.
Why it happen to my application.
How can avoid it?
Please help me to understand where is the bug.
|
|
|
|
|
I think that that is a flicker...
You must enable double-buffering on your controls.
Put this in your constructor:
this.SetStyle ( ControlStyles.OptimizedDoubleBuffer, true );
this.SetStyle ( ControlStyles.AllPaintingInWmPaint, true );
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hello peoples,
I wonder if it is possible to create an instance of an object which type
is stored in a "System.Type" variable:
Example:
<br />
MyClass obj1 = new MyClass();<br />
System.Type type = obj1.GetType();<br />
((type) obj2) = new type();
I could write a huge "switch case" block and then switch through all
existing types, but it would be pretty inflexible and also bad style.
Any ideas ?
|
|
|
|
|
Activator class can help in your case
<br />
System.Type type = typeof(MyClass);<br />
MyClass obj = (MyClass)Activator.CreateInstance(type);<br />
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
Hello tarasn,
the issue here is - I have to know the type(e.g. MyClass) on the left side of given expression and in the casting brakets too:
<br />
MyClass obj = (MyClass)Activator.CreateInstance(type);<br />
But in certain situations the type is unknown... Assuming I have to "unbox" an object of type "System.Object" and I also can get its Type using object.GetType() and store it in a variable:
<br />
System.Type type = object.GetType(); <br />
How can I create a new instance of whatever is boxed in this object?
Maybe some trick with StringBuilder or so...
-- modified at 10:38 Tuesday 17th January, 2006
|
|
|
|
|
Surely you cannot cast but you can still create the object:
System.Type type = object.GetType();<br />
object newObject = Activator.CreateInstance(type);
Note that this only works for objects whose classes define an constructor with no arguments.
|
|
|
|
|
Hi all,
I am calling excel macro function which is available in excel template file.
I get the reference of the work sheet, and iam trying to calling a macro from C#.The code is as below.
System.Diagnostics.Process[] myProcesses;
Excel.ApplicationClass appInstanceReference;
myProcesses = System.Diagnostics.Process.GetProcessesByName("EXCEL");
if ( myProcesses.Length > 0 )
{
Excel.Workbook xlwkbook = (Excel.Workbook) System.Runtime.InteropServices.Marshal.BindToMoniker(System.Windows.Forms.Application.StartupPath + @"\Templates\CommercialSizing.XLT");
if ( xlwkbook != null )
{
appInstanceReference = (Excel.ApplicationClass) xlwkbook.Application;
if ( appInstanceReference != null)
{
appInstanceReference.GetType().InvokeMember("Run",
System.Reflection.BindingFlags.Default |
System.Reflection.BindingFlags.InvokeMethod,
null, appInstanceReference,new object[]
{"'" + System.Windows.Forms.Application.StartupPath + @"\Templates\CommercialSizing.XLT" + "'!YourMacro"}
);
}
}
}
The problem is, it is not just calling macro function, instead of that, it is opening new excel template and it is calling macro function, but the excel sheet is already opened, i just need to execute my macro.what is the change i need to do in my code.Thanks for your help.
|
|
|
|
|
I have found one solution for how to color a row in a DataGrid based on the data in the row. Here's one example: guffy.net[^]. The problem is that it doesn't work when the DataGrid is sorted, or when a RowFilter is applied.
Example:
I have a simple table with two columns, one with integer values and one with strings.
15 Some text
-14 Different text
5 Another string
6 Yet another string
Say I want all rows where the integer is negative to have a blue background. This is easily done using the example above. In this example the second row will be colored blue.
But say I don't want to show any rows with an integer >= 10. When I create the DataGrid I use the code
DataView mainDataView = ((DataTable)this.mainDataGrid.DataSource).DefaultView;
mainDataView.RowFilter = "[Value] < 10";
Now the DataGrid will look like:
-14 Different text
5 Another string
6 Yet another string
But now the second row will have a blue background, instead of the first.
How can I solve this problem? Any help is appriciated!
(btw, I already asked this question in an old thread, but I'm new here and thought a thread would get "bumped" when it got a new message, turns out that the message bord is sorted by the first message in a thread, so I guess noone noticed that message...)
/Cesa
|
|
|
|
|
You should change these two lines
DataRowView v = (DataRowView)source.Current;
string curColumnValue = Convert.ToString(v.DataView.Table.Rows[rowNum][columnName]);
to
DataRowView v = (DataRowView)source.Current;
string curColumnValue = Convert.ToString(v.Row[columnName]);
A DataRowView knows its associated DataRow. Thus you don't have to look into the DataTable.
|
|
|
|
|
Thanks, but for some reason I can't get it to work. To be honest I didn't look into it that much since I managed to find another solution earlier.
I modified your example to my actual project:
DataRowView v = (DataRowView)source.Current;
DateTime date = (DateTime)v.Row["Date"];
...but it doesn't work.
This works fine though:
In class:
//public version of GetColumnValueAtRow
public object PublicGetColumnValueAtRow(System.Windows.Forms.CurrencyManager source, System.Int32 rowNum)
{
return this.GetColumnValueAtRow(source, rowNum);
}
In Paint(...):
DateTime date = (DateTime)((MyDataGridTextBoxColumn)this.DataGridTableStyle.GridColumnStyles["Date"]).PublicGetColumnValueAtRow(source, rowNum);
-- modified at 12:46 Tuesday 17th January, 2006
|
|
|
|
|
Hi
i am working in c# with infragistics
In c# windows applicaion, I will be passing data from textbox..such that
for example:i haev 3 texboxes labeled
name:
age:
salary:....
Now name is the parent and age and salary r the child..so if i pass data in
the appropriate textbox..It should be added in the ultrawintree.......such that
name(parent) should show up on the root node of the tree. and age and
salary(child) should show up under the root node.
I did this as follows..
//ultrawintree
private Infragistics.Win.UltraWinTree.UltraTree ultraTree1;
//form load
private void Form1_Load(object sender, System.EventArgs e)
{
DataSet dataSet = new DataSet();
//read the schema
dataSet.ReadXmlSchema("..\\..\\Menu.xsd");//menu.xsd contains name, age and salary
dataSet.WriteXml("..\\..\\resultdata.xml",XmlWriteMode.WriteSchema);
}
//buttton click
private void button1_Click(object sender, System.EventArgs e)
{
DataSet dataSet = new DataSet();
// Read the existing xml
dataSet.ReadXml("..\\..\\resultdata.xml");
//name textbox----string type
string strName = txtName.Text;
//age text box----int type
string strage = txtAge.Text;
int intAge;
if (!strAge.Equals(string.Empty)) // check to make sure the user entered something
intAge = Convert.ToInt32(strAge);
//Salary textbox------int type
string strSalary = txtSalary.Text;
int intSalary;
if (!strSalary.Equals(string.Empty)) // check to make sure the user entered something
intSalary = Convert.ToInt32(strSalary);
//create a new row
DataRow newrow;
newrow = dataSet.Tables[0].NewRow();
// add new row.
newrow["Name"] = strName;
newrow["Age"] = strAge;
newrow["Salary"] = strSalary;
//add parent node in ultrawintree
Infragistics.Win.UltraWinTree.UltraTreeNode anode = new Infragistics.Win.UltraWinTree.UltraTreeNode();
//add parent node
anode.Text = txtName.Text;
//add child nodes
anode.Nodes.Add(txtAge.Text);
anode.Nodes.Add(txtSalary.Text);
anode.Expanded = true;
ultraTree1.Nodes.Add(anode);
//add the row to the dataset
dataSet.Tables[0].Rows.Add(newrow);
//write the data to a xml file
dataSet.WriteXml("..\\..\\resultdata.xml", XmlWriteMode.WriteSchema);
dataSet.AcceptChanges();
MessageBox.Show("Saved");
}
so now when i run this program, as it reads a xml schema and creates a xml file.. now when i clicked the button, it checks for teh xml file and each textbox
is binded to teh xml elements..so that the data which is passed in the xml file willbe added in teh xml..
now for example i gave john,22,1800 for name,age and salary respectively
it is added inthge xml..no when i give rex, 22,1700again adn when i cick the button..it shows that key already exists..key:22..
so please help met o add this..wht should i do to overcome this error
dhol
|
|
|
|
|
Is it possible to create a dialog represent .NET JIT dialog when application error?
Thank You.
|
|
|
|
|
No, but you can catch your application errors using try/catch blocks. In the catch block, you can display your own custom message with your own dialog if you wish.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Little House on the Flickr
Judah Himango
|
|
|
|
|
I want to convert a string str="ABC=100 BC C=50" to xml
as
<MyXML>
<ABC>
<value>100</value>
<operator>=</operator>
</ABC>
<BC>
<value></value>
<operator></operator>
</BC>
</MyXML>
Is it possible?
bidisha
|
|
|
|
|
if everything is going to be space delimited then it's definately possible.
string s = "abc=100 bc c=50 def=20"
string[] strings = s.Split(" ");
This will give you an array of xml elements split at each space " ". Then you've just gotta go through each one and work out whether or not it has an operator and create your xml file. Just make sure that the only spaces in the string are between elements, if you need spaces elsewhere then use a different character like a comma.
string s = "abc=100,bc,c=50,def=20"
string[] strings = s.Split(",");
Cheers
Kev
|
|
|
|
|
MatchCollection matches = Regex.Matches(str, @"(?<name>[^=\s]+)(=(?<value>\d+))?");
Use this regular expression. This will give you a match collection with the captures "name" and "value". It's easy to transform this into an XML then.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hello all
i want to know how to capture the icon of a file or folder , or at least create shortcut icon for it , and then use it in my application
thx all
|
|
|
|
|
|
Hello,
I'm trying to get all images out of the projects resource file dynamically. I tried it with the System.Resources.ResourceManager class but it will not work! Can someone help me please or does someone have another idea how to get this work properly?
Thx,
Thomas
|
|
|
|
|
Post your code, maybe it needs some modifications...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi,
thanks for your answer. I did some research and now have a simple but stupid solution:
ResourceManager rm = new ResourceManager("ImageLoader.Properties.Resources", System.Reflection.Assembly.GetExecutingAssembly());<br />
<br />
CultureInfo resourceCulture = new CultureInfo("de-AT");<br />
ResourceSet rs = rm.GetResourceSet(resourceCulture, true, true);<br />
<br />
IDictionaryEnumerator id = rs.GetEnumerator();<br />
<br />
ImageList il = new ImageList();<br />
<br />
while (id.MoveNext())<br />
il.Images.Add((Bitmap)id.Value);<br />
<br />
rs.Close();
|
|
|
|
|
I am trying to make a program that kan simulate a keypress on the keyboard. I've tried to use sendkeys and it seem to work fine as long as i stay in a nativ Windows environment.
So what i want to do is to be able to insert a key directly in the keyboard input stream so that i can simulate a keystroke without typing on the keyboard but instead activate it by some other means (like voice or mouseclick).
|
|
|
|
|