|
tried
<br />
<br />
Bitmap temp = new System.Drawing.Bitmap(camera.width, camera.height, stride, System.Drawing.Imaging.PixelFormat.Format24bppRgb, camera.MonocromeFrame);<br />
<br />
DisplayBitmap = new Bitmap(temp.Width,temp.Height);<br />
<br />
for(int y=0;y<DisplayBitmap.Height;y++)<br />
<br />
{<br />
<br />
for(int x=0;x<DisplayBitmap.Width;x++)<br />
<br />
{<br />
<br />
Color c=temp.GetPixel(x,y);<br />
<br />
int luma = (int)(c.R*0.3 + c.G*0.59+ c.B*0.11);<br />
<br />
DisplayBitmap.SetPixel(x,y,Color.FromArgb(luma,luma,luma));<br />
<br />
}<br />
<br />
}
and it lagged beyond compare because it is a huge image.
The board retarded my for loops
here is a link to the code No Paste version of the code [^]
|
|
|
|
|
Wondering how to disconnect my LAN through C#... though there is a way through WMI but any alternate and better solution would be appreciated thanks
Determination and faith are the only keys !
|
|
|
|
|
There is no keyword in C# or class/method in the .NET framework to directly achieve this. You may have to build your own, probably by using the System.Management [^] namespace in the framework, since there is way through WMI.
-----
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
God is the only being who, to rule, does not need to exist. -- Charles Baudelaire
|
|
|
|
|
thanks for taking interest
The problem is, through system.management, i can only get the status of whether the Network Card is enabled or Disabled. The solution is only if the DHCP gets unleased, but thats not the right way i guess. What I want to do is to achieve the Disabling Network Card as i use to do by going in Network connection and disabling it through right click and selecting the particular option "Disable"
Any idea how to do that ?
Determination and faith are the only keys !
|
|
|
|
|
There are a few ways you can do this, below is the easiest method with a WMI script converted to C#;
http://channel9.msdn.com/ShowPost.aspx?PostID=158556[^]
If you download his application (the [Save] link at the bottom of the top post) he included the source code...
|
|
|
|
|
thanks for the reference
Determination and faith are the only keys !
|
|
|
|
|
AssemblyName _tempname = new AssemblyName();
_tempname.Name = "MyTempAssembly";
AssemblyBuilder _Assmblybuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(_tempname, AssemblyBuilderAccess.RunAndSave);
ModuleBuilder _modBldr = _Assmblybuilder.DefineDynamicModule("MainMod", "MyTempAssembly.dll");
string x = "System.Windows.Forms.Button";
TypeBuilder _typeBldr = _modBldr.DefineType(x);
I want to make object of the Type inside _typeBldr ... how?
|
|
|
|
|
Hi
I am using a VB6 application which has embedded Excel sheet in one of its forms.
I am developing a new Web Application in C#/ASP.net 2.0 where the requirement is to save some data in a webpage and then to show the same data (just saved in Web App) in the Excel sheet of the VB6 application.
Problem is I dont know how to refer VB6 application from .Net
Please help me ASAP.
Vinay
|
|
|
|
|
If the VB 6 app reads data stored in excel format then save the data from the web form with an excel format. Then the VB6 app can show the data given the file.
If I see ur problem correctly
|
|
|
|
|
I am sorry for not being clear. I will explain it once again.
I have a VB6 application which has Excel embedded in its Form. Now there is an ASP.NEt application which has a web page with a Save button.
When the user enters data on the Web Page and hits on Save button, 2 Actions has to happen.
1) The data will be saved in Oracle DB
2) The same data needs to be loaded in the Excel present in the VB application.
Action (1) is easy with no problems
Action (2) is my problem as I am not getting the reference of the VB application from C# (2.0)
Please let me know if there is some way to do it.
Vinay
|
|
|
|
|
I am unsure if I understand what you are trying to do. You have a VB6 application which holds the excel stuff. Are you trying to save the data from your ASP application, and then send a message to the VB6 app to read the file after it has been saved? Or are you just saving it, and then letting the user load the data whenever?
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
I am sorry for not being clear. I will explain it once again.
I have a VB6 application which has Excel embedded in its Form. Now there is an ASP.NEt application which has a web page with a Save button.
When the user enters data on the Web Page and hits on Save button, 2 Actions has to happen.
1) The data will be saved in Oracle DB
2) The same data needs to be loaded in the Excel present in the VB application.
Action (1) is easy with no problems
Action (2) is my problem as I am not getting the reference of the VB application from C# (2.0)
Please let me know if there is some way to do it.
Vinay
|
|
|
|
|
Hi.
How do you start synchronously an external application?
My program must suspend execution and wait for the external app to close itself and only then resume execution.
Thanks.
|
|
|
|
|
Take a look at the Process class.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Yes, I know how to start it using the Process class.
But by default, that starts the external application asynchronously, which is not what I want.
|
|
|
|
|
Hello,
Have you had a look at the "WaitForExit()" method of the process class?
Or do you mean something completely different?
All the best,
Martin
|
|
|
|
|
blackjack2150 wrote: But by default, that starts the external application asynchronously, which is not what I want.
As Martin# stated below, I was thinking you could WaitForExit() from the Process class. I didn't notice you wanted to run the process synchronously, despite being in bold I am unsure if the process can be ran synchronously.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
|
this question is for C#. I dont know how to put a value into a label my select statement works because Ive tried it on a listbox heres the code
select sum() from table where id = id
then: label.text = ?;
I tried dataset.tables[0].rows
but Im not to shure about that please help me.
|
|
|
|
|
dataset.tables[0].rows[0], I reckon.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I did but it just shows System.data...
in my select statement I have select sum() as total from
dont I have to put that total in somewhere?
|
|
|
|
|
lourensG wrote: dont I have to put that total in somewhere?
That's what the select did. I thnk you need to add .Value or something like that.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: dataset.tables[0].rows[0], I reckon.
I think it has to be dataset.tables[0].rows[0].ToString();
Also, not more than 4 threads down you have the EXACT same thread, with answeres in it for you. Why did you start a new one, people can still see that. It just makes you look impatient and rude. Read the forum rules
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
try this .....
dataset.Tables[0].Rows[0][0].ToString();
surely work......
|
|
|
|
|
thanks that works perfectly but how does Rows[0][0] work
|
|
|
|