Sunday, September 30, 2012

Simple Camera Capture on C# | Windows 8

Simple Camera Capture on C# | Windows 8 - Hello friend Panduan SEO | Panduan SEO terlengkap tuk pemula yang ingin mulai belajar SEO. Panduan gratis ini meningkatkan pengunjung ke situs anda. On this article you read this time with the title Simple Camera Capture on C# | Windows 8 , We have prepared this article well for you to read and take the information in it. hopefully the contents of the post Articles Windows 8 Champ IPB, That we write this you can understand. okay, happy reading.

Title : Simple Camera Capture on C# | Windows 8
links : Simple Camera Capture on C# | Windows 8

Read also


Simple Camera Capture on C# | Windows 8

Oke langsung saja kita bahas tutorial "Simple Camera Capture on C# | Windows 8", sebenarnya tutorial ini sudah saya posting di blog win8champ IPB tapi supaya lebih komplit tidak ada salahnya saya poting lagi di blog pribadi saya :p


Langsung saja ke step by stepnya ya...


1. Buka Microsoft Visual Studio 2012, buat project baru > Pilih Visual C# > Windows Store >Blank App [XAML] > [Beri nama] > Klik OK.




2 . Klik 2x pada MainPage.xaml.cs  setelah itu copy code dibawah ini.
using Windows.Media.Capture; //forCapture
using Windows.UI.Xaml.Media.Imaging; // for BitmapImage
using Windows.Storage; // for FileAccessMode
Copy dan letakkan code dibawah ini pada OnNavigatedTo() method, karena kita pakai await jadi tambahkan async pada OnNavigatedTo() seperti dibawah ini:
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
var ui = new CameraCaptureUI();
ui.PhotoSettings.CroppedAspectRatio = new Size(4, 3);
var file = await ui.CaptureFileAsync(CameraCaptureUIMode.Photo);
if (file != null)
{
var bitmap = new BitmapImage();
bitmap.SetSource(await file.OpenAsync(FileAccessMode.Read));
Photo.Source = bitmap;
}
}

3.  Pada Package.appxmanifest pada tab Capabilities centang Webcam.


4. Step terakhir : Buka file MainPage.xaml dan tambahkan tag <Image>. Tag tersebut merupakan tempat kita menaruh gambar yang akan ditangkap.
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Image x:Name="Photo" Width="700" Height="700" />
</Grid>

5. Nah sekarang coba tekan F5 untuk menjalankan aplikasinya...





Untuk lebih banyak lagi info atau source mengenai Windows 8, silahkan saja mampir di blog resmi Windows 8 Champ IPB di http://win8champ.event.ipb.ac.id




Thus the article Simple Camera Capture on C# | Windows 8

That's an article Simple Camera Capture on C# | Windows 8 This article will be useful for you all. okay, see you in other article posting. Do not forget to keep visiting on Panduan SEO | Blogger, Tips , Adsense, Google.

You are now reading the article Simple Camera Capture on C# | Windows 8 with the link address https://belajarpanduanseo.blogspot.com/2012/09/simple-camera-capture-on-c-windows-8.html


Do not forget to share ^_^ because sharing is caring and I'm waiting for your comment




EmoticonEmoticon