本文整理汇总了C#中System.Windows.Media.Imaging.BitmapImage.GetBgr24Data方法的典型用法代码示例。如果您正苦于以下问题:C# BitmapImage.GetBgr24Data方法的具体用法?C# BitmapImage.GetBgr24Data怎么用?C# BitmapImage.GetBgr24Data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Imaging.BitmapImage
的用法示例。
在下文中一共展示了BitmapImage.GetBgr24Data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TopWallpaperRenderer
static TopWallpaperRenderer()
{
ScreenArea = new Rect(0, 0, 412, 240);
var defTopAlt = new BitmapImage();
defTopAlt.BeginInit();
//defTopAlt.StreamSource = (Stream) Extensions.GetResources(@"TopAlt_DefMask\.png").First().Value;
defTopAlt.UriSource = new Uri(@"pack://application:,,,/ThemeEditor.WPF;component/Resources/TopAlt_DefMask.png");
defTopAlt.CacheOption = BitmapCacheOption.OnLoad;
defTopAlt.EndInit();
var bgrData = defTopAlt.GetBgr24Data();
RawTexture rTex = new RawTexture(defTopAlt.PixelWidth, defTopAlt.PixelHeight, RawTexture.DataFormat.A8);
rTex.Encode(bgrData);
DefaultTopSquares = new TextureViewModel(rTex, null);
RenderToolFactory.RegisterTool<PenTool, Pen>
(key => new Pen(new SolidColorBrush(key.Color)
{
Opacity = key.Opacity
},
key.Width));
RenderToolFactory.RegisterTool<SolidColorBrushTool, Brush>
(key => new SolidColorBrush(key.Color)
{
Opacity = key.Opacity
});
RenderToolFactory.RegisterTool<LinearGradientBrushTool, Brush>
(key => new LinearGradientBrush(key.ColorA, key.ColorB, key.Angle)
{
Opacity = key.Opacity
});
RenderToolFactory.RegisterTool<ImageBrushTool, Brush>
(key => new ImageBrush(key.Image)
{
TileMode = key.Mode,
ViewportUnits = key.ViewportUnits,
Viewport = key.Viewport,
Opacity = key.Opacity
});
Type ownerType = typeof(TopWallpaperRenderer);
IsEnabledProperty
.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(false, OnIsEnabledChanged));
ClipToBoundsProperty.OverrideMetadata(ownerType,
new FrameworkPropertyMetadata(true, null, (o, value) => true));
WidthProperty.OverrideMetadata(ownerType,
new FrameworkPropertyMetadata(412.0, null, (o, value) => 412.0));
HeightProperty.OverrideMetadata(ownerType,
new FrameworkPropertyMetadata(240.0, null, (o, value) => 240.0));
EffectProperty.OverrideMetadata(ownerType,
new FrameworkPropertyMetadata(default(WarpEffect),
null,
(o, value) => ((TopWallpaperRenderer) o).GetWarpEffectInstance()));
}