を保存しないようにどのように、私はコードのこのセットを研究している、
https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CameraStarterKitUWPアプリケーションでMediaCaptureを行うが、私はカメラ機能でUWPアプリケーションを開発していますローカルマシンに
に成功は私の上のカメラ機能を開発応用。しかし、私のアプリケーションでは、はローカルマシンに画像を保存しないようにしたいと考えています。アプリケーションは実際にキオスクシステムのようなものなので、誰もが同じマシンを使って画像を撮ることになります。
実際には、ユーザーがキオスクシステムを通じて自分のメールアドレスに撮影した画像を送信できるようにする予定です。彼らは写真を撮影しているときに、プレビューが表示され、ユーザーが画像を送信する場合にのみ、その絵は私のテイク写真用コード
を「保存」になります機能は次のようなものです:
rivate async Task TakePhotoAsync()
{
var stream = new InMemoryRandomAccessStream();
Debug.WriteLine("Taking photo...");
await _mediaCapture.CapturePhotoToStreamAsync(ImageEncodingProperties.CreateJpeg(), stream);
try
{
var file = await _captureFolder.CreateFileAsync("SimplePhoto.jpg", CreationCollisionOption.GenerateUniqueName);
Debug.WriteLine("Photo taken! Saving to " + file.Path);
var photoOrientation = CameraRotationHelper.ConvertSimpleOrientationToPhotoOrientation(_rotationHelper.GetCameraCaptureOrientation());
await ReencodeAndSavePhotoAsync(stream, file, photoOrientation);
Debug.WriteLine("Photo saved!");
}
catch (Exception ex)
{
// File I/O errors are reported as exceptions
Debug.WriteLine("Exception when taking a photo: " + ex.ToString());
}
}
と画像のプレビューを取得するために、次のようになります。
private async Task GetPreviewFrameAsSoftwareBitmapAsync()
{
// Get information about the preview
var previewProperties = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;
// Create the video frame to request a SoftwareBitmap preview frame
var videoFrame = new VideoFrame(BitmapPixelFormat.Bgra8, (int)previewProperties.Width, (int)previewProperties.Height);
// Capture the preview frame
using (var currentFrame = await _mediaCapture.GetPreviewFrameAsync(videoFrame))
{
// Collect the resulting frame
SoftwareBitmap previewFrame = currentFrame.SoftwareBitmap;
// Show the frame information
FrameInfoTextBlock.Text = String.Format("{0}x{1} {2}", previewFrame.PixelWidth, previewFrame.PixelHeight, previewFrame.BitmapPixelFormat);
// Create a SoftwareBitmapSource to display the SoftwareBitmap to the user
var sbSource = new SoftwareBitmapSource();
await sbSource.SetBitmapAsync(previewFrame);
// Display it in the Image control
PreviewFrameImage.Source = sbSource;
}
}
こんにちは、私はまだ学生のUWPを学んでいるので、私は非常にSmtpClientが何であるかはわかりません...そして、もし私が最初の選択肢に行きたいのであれば、絵はまだありますか?ローカルマシンに保存されていますか? – thalassophile
SmtpClientはSMTPサーバー(電子メールを送受信するもの)に接続します。参考になるサンプルがある場合は... – thalassophile
SmtpClientがSMTPサーバーに接続します。 – cherepets