![]() Call GetSoftwareBitmapAsync to get a SoftwareBitmap object containing the image. Call the static method BitmapDecoder.CreateAsync to get an instance of the BitmapDecoder class for the specified stream. The user cancelled the picking operationĬall the OpenAsync method of the StorageFile object to get a random access stream containing the image data. Var inputFile = await fileOpenPicker.PickSingleFileAsync() FileOpenPicker fileOpenPicker = new FileOpenPicker() įileOpenPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary į(".jpg") įileOpenPicker.ViewMode = PickerViewMode.Thumbnail This example uses a FileOpenPicker to allow the user to select an image file. To create a SoftwareBitmap from a file, get an instance of StorageFile containing the image data. using Windows.Storage Ĭreate a SoftwareBitmap from an image file with BitmapDecoder The sample code in this article uses APIs from the following namespaces. VideoFrame allows you to get a SoftwareBitmap representation of a VideoFrame.įaceDetector allows you to detect faces in a SoftwareBitmap. Also, SoftwareBitmap is a common interface used by multiple features of Windows, including:ĬapturedFrame allows you to get frames captured by the camera as a SoftwareBitmap. SoftwareBitmap allows you to easily convert between different pixel formats and alpha modes, and allows low-level access to pixel data. The SoftwareBitmap class is a versatile API that can be created from multiple sources including image files, WriteableBitmap objects, Direct3D surfaces, and code. This article explains how to load and save image files using BitmapDecoder and BitmapEncoder and how to use the SoftwareBitmap object to represent bitmap images.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |