bitmapframe

Saving Windows.Media.Drawing with BmpBitmapEncoder black image - how to remove alpha?

南楼画角 提交于 2019-12-25 03:54:44
问题 I'm using SVG# (http://sharpvectors.codeplex.com/), to batch convert SVG files to other formats. The SVG images being converted are black line drawings with no background. I've little experience with WPF or the System.Windows.Media namespace, so please excuse me if this is a basic question. I'm using a modified version of the ImageSvgConverter from SVG#, which accepts a System.Windows.Media.Drawing object, which is then converted using a System.Windows.Media encoder ( BmpBitmapEncoder ,

Create BitmapFrame asynchronously in an async method

♀尐吖头ヾ 提交于 2019-12-20 07:41:23
问题 Anyone knows how to create BitmapFrame asynchronously in WPF? I want to batch print XAML Image element whose Source property is set code behind. Here LogoImageUrl is the URL of the web image I want to load asynchronously. LogoImage.Source = BitmapFrame.Create(new Uri(LogoImageUrl)); Can I create an async method like this: public async Task<BitmapFrame> GetBitmapFrame(Uri uri) { await ... // What to be awaited? return BitmapFrame.Create(uri); } ...so I can use that method in a try block and

BitmapFrame in WPF ComboBox

血红的双手。 提交于 2019-12-12 01:15:33
问题 I have a dialog that lets the user pick a custom icon. Loaded icons are displayed in a combobox in which the user makes the selection. Here is the XAML code for the combobox: <ComboBox Style="{DynamicResource IconComboBox}" ItemTemplate="{StaticResource IconTemplate}" ItemsSource="{Binding Icons, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" SelectedItem="{Binding Icon}" /> Icons is a property that returns an array of BitmapFrame . Icon is a property for

Create BitmapFrame asynchronously in an async method

纵然是瞬间 提交于 2019-12-02 11:15:54
Anyone knows how to create BitmapFrame asynchronously in WPF? I want to batch print XAML Image element whose Source property is set code behind. Here LogoImageUrl is the URL of the web image I want to load asynchronously. LogoImage.Source = BitmapFrame.Create(new Uri(LogoImageUrl)); Can I create an async method like this: public async Task<BitmapFrame> GetBitmapFrame(Uri uri) { await ... // What to be awaited? return BitmapFrame.Create(uri); } ...so I can use that method in a try block and then print it in finally block? You should asynchronously download the web image and create a BitmapFrame