mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-07 23:45:05 +00:00
WinUI: use WriteableBitmap instead of BitmapImage or SoftwareBitmapSource
This commit is contained in:
parent
d2fc65f133
commit
ff6f6b63ea
2 changed files with 30 additions and 107 deletions
|
|
@ -6,11 +6,6 @@ using System;
|
|||
using System.Threading.Tasks;
|
||||
using Windows.Graphics.Imaging;
|
||||
using Windows.Storage;
|
||||
#if WINUI
|
||||
using Microsoft.UI.Xaml.Media.Imaging;
|
||||
#else
|
||||
using Windows.UI.Xaml.Media.Imaging;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
|
|
@ -22,17 +17,11 @@ namespace MapControl
|
|||
|
||||
using (var stream = await file.OpenReadAsync())
|
||||
{
|
||||
WriteableBitmap bitmap;
|
||||
Matrix transform;
|
||||
MapProjection projection = null;
|
||||
|
||||
var decoder = await BitmapDecoder.CreateAsync(stream);
|
||||
|
||||
using (var swbmp = await decoder.GetSoftwareBitmapAsync())
|
||||
{
|
||||
bitmap = new WriteableBitmap(swbmp.PixelWidth, swbmp.PixelHeight);
|
||||
swbmp.CopyToBuffer(bitmap.PixelBuffer);
|
||||
}
|
||||
var bitmap = await ImageLoader.LoadImageAsync(decoder);
|
||||
|
||||
var geoKeyDirectoryQuery = QueryString(GeoKeyDirectoryTag);
|
||||
var pixelScaleQuery = QueryString(ModelPixelScaleTag);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue