|
If you use your version of Sven's code, you need to use Visual Studio's debugging capabilities ... set break-points, single-step, etc. ... and isolate the problem in your code. Since you have Sven's code, which is working, you have something to compare directly with.
I am interested in helping people who develop their own solutions because that, I think, results in the maximum contribution of value to both the individual learning C# and writing code, and to CodeProject as a whole. Debugging/fixing a copy of another person's obscure undocumented code is not an activity that contributes to CodeProject, or you.
I repeat my assertion that you can achieve better looking, smoother scrolling, animation, than what Sven's code does.
You'll learn a lot writing your own version !
cheers, Bill
« I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant
|
|
|
|
|
how do i delete my visual stuio project
|
|
|
|
|
Try this[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Hi,
I am writing an application with Windows forms which has to enable user to select a webcam connected to his computer via USB and print the video stream in the window. I need to get some of the frames (let say every 5th frame, but it depends on fps I get) and search it for an graphic object that was defined earlier by the user.
As I am new to c# and Visual Studio I was searching for an example of an application similar to what I want to do. I found a few examples on AForgery, but I would like to print original video with just added a few markers on it and AForgery gives me processed frames. Also, when I aded simple processing in the receving new frame event, the performace was pretty bad. I tried the WIA and what I get is an error when I try to call device selection dialog.
Device dev = dialog.ShowSelectDevice(WiaDeviceType.CameraDeviceType,true,false);
What I get is HRESULT exception with error code 0x80210015. I am not sure if WIA is exactly what I need, but because of this error I can't check it.
I need help with selecting the best video stream fiting that kind of application and the more I search, the more I am confused. I do not need to send video over IP or save it. I just need to present the video stream from the camera and sometimes get a frame (the best would be RGB) for processing. I would appreciate any suggestions on stream selecting or linking documentations/examples.
|
|
|
|
|
You may want to check out this[^] article.
admbrt wrote: AForgery I think you meant AForge.
/ravi
|
|
|
|
|
Thanks, I think this will do it.
And of course i meant AForge 
|
|
|
|
|
|
Thanks, while working on this project I came across OpenCV and I think that is exactly what I need as in the future there will be some imageprocessing in my project. So I guess I'll use OpenCV to do all the work with Webcam.
|
|
|
|
|
Hi,
I am wondering when I can get the finger print attendance device without any finger print system.
I want to use it for testing finger attendance system in C#
I tried searching the net for it but I couldn't find it and I am not sure what do you call the device?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
This[^] vendor seems to sell inexpensive devices and SDKs.
/ravi
|
|
|
|
|
How to use entity frame work in MVC web Application to fetch bulk records from database by joining multiple tables in MVC Web Application.
|
|
|
|
|
See this[^] tutorial.
/ravi
|
|
|
|
|
Seriously? There are entire BOOKS written on that very subject. You want someone to copy and paste and entire book into a forum post??
|
|
|
|
|
|
How to get the screen shots of dynamic display chart for a list of values?
In a loop need to change the line graph for each iteration and have to get the screenshot for the same.
|
|
|
|
|
Where are you stuck?
And: why do you want to take screen shots? What about saving the charts as images to disk?
|
|
|
|
|
You do know that it's dynamic data don't you? So, change the data and then capture the screenshot. There's even an article on here that shows thow to capture the screen[^].
|
|
|
|
|
anyone can help me,.,
i try to make a graph in c# like this video in youtube :
http://www.youtube.com/watch?v=Tay4t1Wo-As[^]
i have been doing all of procedure like this tutorial..
in tutorial
when program running..no error happend..
when i try run my program that i made, error happend
error program is = "axMathworks_Strip1.AddXY(0, a, Convert.ToDouble(textBox1.Text));"
this is a full program
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace nyobaan_library1
{
public partial class Form1 : Form
{
Double a,b;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
button1.Enabled = false;
}
private void timer1_Tick(object sender, EventArgs e)
{
a++;
axMathworks_Strip1.AddXY(0, a, Convert.ToDouble(textBox1.Text));
}
}
}
iam using library MWStrip.ocx active X
computer say :
"nput string was not in a correct format."
any one can help me????
|
|
|
|
|
What value is in your TextBox? You might want to try something like this:
double coordinate;
if (double.TryParse(txtBox1.Text, out coordinate)
{
axMathworks_Strip1.AddXY(0, a, coordinate);
}
|
|
|
|
|
thanks so much ....^_^
i am still not understand..
why this coding error
"axMathworks_Strip1.AddXY(0, a, Convert.ToDouble(textBox1.Text));"
in video tutorial, error is not happening???
Convert.ToDouble(textBox1.Text)); error in this section....
and your coding
double coordinate;
if (double.TryParse(txtBox1.Text, out coordinate)
{
axMathworks_Strip1.AddXY(0, a, coordinate);
}
i add "a++" when i run, the program successfully executed....can u give me short explanation...sorry for my english..
|
|
|
|
|
The reason my version works and yours didn't is because of what TryParse does. Basically, if it cannot parse the value into a double then it will not execute the Add section. Using Convert.ToDouble will throw an exception if it cannot convert the value.
|
|
|
|
|
thanks for the enlightenment, it was so helping me ....
|
|
|
|
|
I tried to connect the data adc atmega 16 microcontroller application to C # that has been created with the help of the code that you help ..
private void timer1_Tick (object sender, EventArgs e)
{
double coordinate;
b ++;
if (double.TryParse (txtDataTerima.Text, out coordinate))
{
axMathworks_Strip1.AddXY (0, b, coordinate);
}
}
This code can only display data manually ..
I try to make it automatically with the help of serial ports
but in a textbox that I created
the data that I received with the help of data reception code:
string a;
private void serialPort_DataReceived (object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
txtDataTerima.BeginInvoke (new myDelegate (updateTextBox));
}
public delegate void myDelegate ();
public void updateTextBox ()
{
a = serialPort.ReadExisting ();
txtDataTerima.AppendText (a);
txtDataTerima.ScrollToCaret ();
}
textboxt data displayed through serial communication, data updates down when there are changes in the value of adc input of the microcontroller
I try again to change the code
acceptance of data updates
full program
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace GrafikADC
{
public partial class Form1 : Form
{
double b;
double apa;
string a;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//—menset event handler untuk DataReceived event—
// serialPort.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler();
//—menampilkan nama serialport yang tersedia pada
// komputer—
string[] portNames = System.IO.Ports.SerialPort.GetPortNames();
for (int i = 0; i <= portNames.Length - 1; i++)
{
cbbCOMPorts.Items.Add(portNames[i]);
}
btnDisconnect.Enabled = false;
}
private void btnConnect_Click(object sender, EventArgs e)
{
//—menutup akses serialport apabila akses serialport terbuka—
if (serialPort.IsOpen)
{
serialPort.Close();
}
try
{
//—mengatur beberapa parameter untuk koneksi serial
// port—
serialPort.PortName = cbbCOMPorts.Text;
serialPort.BaudRate = 9600;
serialPort.Parity = System.IO.Ports.Parity.None;
serialPort.DataBits = 8;
serialPort.StopBits = System.IO.Ports.StopBits.One;
//—buka serial port—
serialPort.Open();
//—menampilkan status dari serial port dan
// enable/disable -kan tombol—
lblMessage.Text = cbbCOMPorts.Text + " connected.";
btnConnect.Enabled = false;
btnDisconnect.Enabled = true;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void btnDisconnect_Click(object sender, EventArgs e)
{
try
{
//—tutup serial port—
serialPort.Close();
//—menampilkan status dari serial port dan
// enable/disable -kan tombol—
lblMessage.Text = serialPort.PortName + " disconnected.";
btnConnect.Enabled = true;
btnDisconnect.Enabled = false;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void serialPort_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
txtDataTerima.BeginInvoke(new myDelegate(updateTextBox));
}
public delegate void myDelegate();
public void updateTextBox()
{
a = serialPort.ReadExisting();
txtDataTerima.AppendText(a);
txtDataTerima.ScrollToCaret();
txtDataTerima.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
timer1.Start();
button3.Enabled = false;
}
private void timer1_Tick(object sender, EventArgs e)
{
double coordinate;
b++;
if (double.TryParse(txtDataTerima.Text, out coordinate))
{
axMathworks_Strip1.AddXY(0, b, coordinate);
}
}
}
}
This is a program I created delivery microcontroller :
#include <mega16.h>
#include <delay.h>
int a,b;
char riki[33];
// Alphanumeric LCD functions
#include <alcd.h>
// Standard Input/Output functions
#include <stdio.h>
#define ADC_VREF_TYPE 0x00
// Read the AD conversion result
unsigned int read_adc(unsigned char adc_input)
{
ADMUX=adc_input | (ADC_VREF_TYPE & 0xff);
// Delay needed for the stabilization of the ADC input voltage
delay_us(10);
// Start the AD conversion
ADCSRA|=0x40;
// Wait for the AD conversion to complete
while ((ADCSRA & 0x10)==0);
ADCSRA|=0x10;
return ADCW;
}
while (1)
{
// Place your code here
a = read_adc(2);
lcd_gotoxy(0,0);
sprintf(riki, "adc1=%d",a);
lcd_puts(riki);
delay_ms(50);
lcd_clear();
printf("%d\n", a);delay_ms(100);
}
}
|
|
|
|
|
I'm assuming it be due to the textbox value. Some countries use a dot as decimal seperator, others use a comma. In the background of the code this is not so. (always dot). To make sure that your textbox value parses to a double correctly look into the double.TryParse function.
|
|
|
|