日期:2014-05-17 浏览次数:20902 次
TimerHandle = new TimerElapsedHandler(MyTimer);
timespace = TimeSpan.FromMilliseconds(5000); //设定的Timer时间(毫秒)
DelayTimer = ThreadPoolTimer.CreatePeriodicTimer(TimerHandle, timespace);
private async void MyTimer(ThreadPoolTimer timer)
{
_imageStream = new InMemoryRandomAccessStream();
await m_mediaCaptureMgr.CapturePhotoToStreamAsync(_encodingProps, _imageStream);
await _imageStream.FlushAsync();
bitmap = new WriteableBitmap(300, 200);
_imageStream.Seek(0);
bitmap.SetSource(_imageStream);
image.Source = bitmap;
}