|
I am trying to populate a toolstripcombobox with an arraylist. I tried :
toolstripcombobox1.combobox.datasource = arraylist,
but nothing shows up in the combobox
any suggestions on how to do this?
Tom
|
|
|
|
|
hehe I found the solution hehe
foreach (var item in arraylist)
{
toolstripcombobox1.items.add(item)
}
|
|
|
|
|
I would extend the toolstripcombobox to a new control that can have a new DataSource property which accepts type arraylist and then parse that internally to compartmentalize your controls better to split up your logic more efficiently.
|
|
|
|
|
does any one have an idea about audio and vedio capturing and playbaking it ?
if so plz put ya ideas on how to do it ?
thanx
|
|
|
|
|
One word - DirectShow.
Does all you need, and more...
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
can u gimme a short brief abt it ?
THANX
|
|
|
|
|
Google it, do some research for &%*^s sake.
|
|
|
|
|
As mentioned above, you can find hundreds of examples on the net (hey, even on Code Project! ) with a bit of searching, but to get you started, here's the official documentation for it[^]...
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
It is unclear from your post if you are wanting to do capturing of your computer's screen and the computer's audio or the audio and video from an external mic and a camera.
Taverso DAW[^] is an open source utility and can do audio recording and processing.
CamStudio[^] is an open source utility that can capture audio and video simultaneously (from the board display and board audio card).
I am not sure if that could possibly help you. But that's all I can give you with the information available on your post. Also, they may not be C# applications (even though I'm pretty sure there are C# wrappers around these at CodePlex).
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
The guys that are the gurus today started with just a pixel. It changed color as the sensor moved to a light environment to a dark environment. Then they got the opportuntity to mess around with two pixels, then three.. then 25. As the number of pixels they were recording over time increased, they had different techniques to capture the video, and different techniques to play back the video.
Now we have very high resolution, but many of the same tecniques still apply to the single pixel screen. If you are thinking about creating your own video capture utility I would strongly recommend that you review the history of the video recording and capture technology as you learn to spell.
Life is too short to program in Visual Basic.
|
|
|
|
|
Nooner wrote: I would strongly recommend that you review the history of the video
I think you are asking too much of him, this guy can't even use Google so actually doing some research seems a little beyond him.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I just know there is one generics: ArraySegment, is used to take one part of an array.
but I really do not understand why this special generics is given (in contranst to other more general generics such as List<>, Dictionary<> and so on). because it seems to me it can only realize single function: take one part of an array.
therefore, is it necessary to define one generics ArraySegment? instead, one method can be added into Array or List is just fine.
Perhaps my understanding is not correct.
thanks
|
|
|
|
|
Huh, never heard of it, I wrote my own, I'll have to take a look at it.
I suspect that part of the reasoning for it is that the D language has array slicing built in.
|
|
|
|
|
I too had not looked at this before.
From a brief look, I think you are largely correct, although there is (very) slightly less typing involved in array slicing when using it.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi, i wanna retrieve my blob data from mysql database..
After retrieving it, i wanna use the image on one of my button.
How do i do that? any clues?
|
|
|
|
|
Get the data as a byte array, load the array into a MemoryStream, use Image.FromStream() to read it as an image. Apart from the blob being a byte array, the method of retrieving the data is as usual. If you have a MySQL database driver installed on the computer, the DataGridView will automatically show the blob as an image
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
I dont quite know how to do that, but this is the code i have
private void getMainCommImages()
{
Byte[] image = null;
MySqlDataReader reader = db.getMainCommImages();
while (reader.Read())
{
image = new Byte[(reader.GetBytes(0,0,null,0,int.MaxValue))];
reader.GetBytes(0, 0, image, 0, image.Length);
reader.Close();
db.Close();
}
}
public MySqlDataReader getMainCommImages()
{
Connect();
command = conn.CreateCommand();
command.CommandText = "SELECT image from images";
reader = command.ExecuteReader();
return reader;
}
after getting the image in bytes. how do i display out to my button
modified on Thursday, June 11, 2009 1:29 PM
|
|
|
|
|
So where does it fail? Do you get the correct byte array? If you do, then simply create a MemoryStream(byte[]) and use Image.FromStream
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Thanks i got it working.
Btw, i have 15 buttons name btn1, btn2, btn3 etc etc
i have 15 images as well in my database. How do i get those images to be on each button.
private void getMainCommImages()
{
Byte[] image = null;
MySqlDataReader reader = db.getMainCommImages();
MemoryStream ms;
Image returnImage;
while (reader.Read())
{
image = new Byte[(reader.GetBytes(0,0,null,0,int.MaxValue))];
reader.GetBytes(0, 0, image, 0, image.Length);
ms = new MemoryStream(image);
returnImage = Image.FromStream(ms);
for (int i = 1; i < 15; i++)
{
btn[i].Image = returnImage;
}
}
reader.Close();
db.Close();
}
something wrong with this part btn[i].Image = returnImage;
|
|
|
|
|
Every button's image will be the last image read from the database. Try something like this:
private void getMainCommImages()
{
Byte[] image = null;
MySqlDataReader reader = db.getMainCommImages();
MemoryStream ms;
Image returnImage;
int i = 0;
while (reader.Read())
{
image = new Byte[(reader.GetBytes(0,0,null,0,int.MaxValue))];
reader.GetBytes(0, 0, image, 0, image.Length);
ms = new MemoryStream(image);
returnImage = Image.FromStream(ms);
foreach(Control ctrl in this.Controls)
{
if(ctrl.Name == "btn" + i.ToString())
{
ctrl.Image = returnImage;
break;
}
}
i++;
}
reader.Close();
db.Close();
}
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
i got this error
Error 1 'System.Windows.Forms.Control' does not contain a definition for 'Image' and no extension method 'Image' accepting a first argument of type 'System.Windows.Forms.Control' could be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Fossil\Desktop\IITSC_App\IITSC_App\IITSC_App\IITSC_App\frmMain.cs 104 30 IITSC_App
|
|
|
|
|
its ok. I got it working
Thanks for your help..
This is my solution
private void getMainCommImages()
{
Byte[] image = null;
MySqlDataReader reader = db.getMainCommImages();
MemoryStream ms;
Image returnImage;
int i = 1;
while (reader.Read())
{
image = new Byte[(reader.GetBytes(0,0,null,0,int.MaxValue))];
reader.GetBytes(0, 0, image, 0, image.Length);
ms = new MemoryStream(image);
returnImage = Image.FromStream(ms);
foreach (Control ctrl in tabPage3.Controls)
{
if (ctrl is Button)
{
if (ctrl.Name == "btn" + i.ToString())
{
((Button)ctrl).Image = returnImage;
break;
}
}
}
i++;
}
reader.Close();
db.Close();
}
|
|
|
|
|
I am looking at a series of header files with thousands of #define statements in them. I have been tasked with writing a utility that utilizes these defines in C#. I know that I can manually convert these, but unfortunately they are living files and I would have a maintenance nightmare.
My question is does anyone have or used any utilities that can be run has a pre-build process from inside VS that converts header file #define to C# constant?
Any help on this is greatly appreciated!
~Mike
|
|
|
|
|
You can use the utility MSBuild Task[^] that provides the code that runs during the build process.
You need to include the code to convert header file #define to C# constant
|
|
|
|
|
I use the C pre-processor and then pass the result to CSC. But I don't know about integrating that with VS.
One of the problems with trying to automatically convert it is that the macroes don't specify a type.
Another solution would be to store the items in XML and then use XSLT to produce either C/C++ (h) or C# code as required.
|
|
|
|