|
And how are you going to switch off the Webcam notification itself? You know, the light that appears on the camera when it's in use.
|
|
|
|
|
Since all the webcams are inside the cage the light can not be seen by the user.
|
|
|
|
|
Do take note that this might not be legal in some places
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Don't worry, the DropBoxes are generally like this and it does not have any illegal elements. And by the way we are actually looking for something where there is no preview - just capture on demand. So, even if the user sees the light of the webcam it really doesn't matter because it actually strengthens his side in case of any dispute unless he claims anything useless (like claiming transaction without dropping the envelop).
|
|
|
|
|
Eddy didn't mean illegal activity, but more of the legality of having a person on camera. You may need to have consent from the person or some notification that they are being filmed.
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
Ultimately the webcam image is just a stream of bytes. That's all you need to know to work out the rest.
|
|
|
|
|
Yes. But how do I do it without showing it on the image control?
|
|
|
|
|
It's a stream of bytes. The image control just renders the bytes out - it's a convenience for you. You don't need it. Think about how you save a stream of bytes instead - that's the key. Forget that the Image Control ever existed.
|
|
|
|
|
This is where I failed to implement. Can you please share with me a few codes so I could understand the fact to store the stream anything other than the image control and grab the current from that variable?
|
|
|
|
|
You already have the code. All you need to do is use a FileStream instead of a MemoryStream to write the bytes out to a file.
|
|
|
|
|
Still cannot figure out. Please help the novice.
|
|
|
|
|
Please find below the extarct of my application where the stream is stored in an image control named frameHolder and function SavePic grabs the current frame and save it to disk. frameHolder is shown on the Main Window. Making it invisible captures blank picture.
MainWindow.xaml.cs
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
LoaclWebCamsCollection = new FilterInfoCollection(FilterCategory.VideoInputDevice);
LocalWebCam = new VideoCaptureDevice(LoaclWebCamsCollection[0].MonikerString);
LocalWebCam.DesiredFrameSize = new System.Drawing.Size(320, 240);
//MessageBox.Show(LocalWebCam.DesiredFrameSize.ToString());
LocalWebCam.NewFrame += new NewFrameEventHandler(Cam_NewFrame);
LocalWebCam.Start();
}
void Cam_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
BitmapImage bi = new BitmapImage();
try
{
img = (Bitmap)eventArgs.Frame.Clone();
MemoryStream ms = new MemoryStream();
img.Save(ms, ImageFormat.Bmp);
ms.Seek(0, SeekOrigin.Begin);
bi.BeginInit();
bi.StreamSource = ms;
bi.EndInit();
bi.Freeze();
Dispatcher.BeginInvoke(new ThreadStart(delegate
{
frameHolder.Source = bi;
}));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "NW CDM Test of Image Capture Failed");
}
}
Sultan Uz Zaman at 4 hrs ago
Reply Modify the comment. Delete the comment.
A button click event does the follwoing to save the pic:
public static void SavePic(string imageFile)
{
//Cam_NewFrame(null,null);
//image1.Source = frameHolder.Source;
//Image frame = frameHolder.Cam_NewFrame(null,null);
// Release any previous buffer
MainWindow myWin = Application.Current.MainWindow as MainWindow;
RenderTargetBitmap bitmap = new RenderTargetBitmap(320, 240, 96, 96, PixelFormats.Pbgra32);
bitmap.Render(myWin.frameHolder);
using (FileStream stream = File.Create(Global.xImageLocation+"\\"+imageFile)) // or .png
{
JpegBitmapEncoder encoder = new JpegBitmapEncoder();
encoder.QualityLevel = 90;
encoder.Frames.Add(BitmapFrame.Create(bitmap));
encoder.Save(stream);
}
}
|
|
|
|
|
Didn't you just post a code dump about this the other day? If so, what part of the code doesn't work?
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
Friends i use this code to get image from database
and show it on picturebox1
but i am getting
this error
system.drawing.image.fromstream(stream stream,boolean ....)
in database column datatype is varbinary(MAX)
byte[] data = new byte[0];
data = (byte[])(dsetName.Tables[0].Rows[0]["picture"]);
MemoryStream mem = new MemoryStream(data);
pictureBox1.Image = Image.FromStream(mem);
if there is some thing missing in my code than suggest me
|
|
|
|
|
You haven't actually told us what error you're getting.
|
|
|
|
|
error is Parameter not valid and
system.drawing.image.fromstream(stream stream ,boolean)
|
|
|
|
|
|
in my program a sending some text to an active windows.
i send like this:
.
.
.
MSG = lblMSG.Text.Trim();
SendKeys.Send(MSG);
SendKeys.SendWait("{ENTER}");
SendKeys.Flush();
the problem is - sometime the string Changing for no reason.
for example:
9999.999 ==> 9999.9999
9999.999 ==> 999.999
why ?
|
|
|
|
|
Message Closed
modified 7-Sep-15 5:20am.
|
|
|
|
|
Is there a question or problem? This looks just to be a code dump.
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
|
I have removed your code. The forums in Code Project are not intended to act as a personal back-up store for code.
|
|
|
|
|
That's what I wondered about it looking like a code dump. He could at least write an article on it if he wanted to share it with the community
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
All i found is real matrix svd, i want complex matrix. so i need help ,please .thank you.
i want c# lib.
|
|
|
|
|
Hi
I am calling a SSRS report from C#. A main report and a subreport in it.
The main report is working correctly but the subreprot is showing The subreport 'Name' could not be found at location
I put the main report and subreport in the bin folder.
Please find the code used by me as below
sqlcomm = new SqlCommand("mainreport query", conn);
SqlDataAdapter dataAdapter = new SqlDataAdapter(sqlcomm);
dataAdapter.Fill(dataset);
this.reportViewer1.ProcessingMode = ProcessingMode.Local;
this.reportViewer1.LocalReport.ReportPath = Application.StartupPath + "\\sale_dept.rdl";
this.reportViewer1.LocalReport.DataSources.Clear();
this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", dataset.Tables[0]));
this.reportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(addsubreport);
this.reportViewer1.LocalReport.Refresh();
this.reportViewer1.RefreshReport();
private void addsubreport(object sender, SubreportProcessingEventArgs e)
{
SqlConnection conn = new SqlConnection(source);
DataSet dataset = new DataSet();
conn.Open();
SqlCommand sqlcomm = new SqlCommand("subreport query", conn);
SqlDataAdapter dataAdapter = new SqlDataAdapter(sqlcomm);
dataAdapter.Fill(dataset);
e.DataSources.Add(new ReportDataSource("discount", dataset.Tables[0]));
}
When i done debug with breakpoint it found that the eventhandler is not getting fired.
The control is not going to the 'addsubreport' event handler. I am stucked here please help
|
|
|
|