[C++] Access Violation When Setting ImageSource on Rectangle Opacity
Posted: 07 Aug 2018, 16:42
If i do not set the Image Source, every thing works out fine. However when setting the opacity mask on a rectangle I'm getting an Access Violation within my Render Delegate while trying to accessing the Device of the GetRenderer() cast. The cast works fine, but the GetDevice() throws the AccessViolation
Code: Select all
<Button x:Name="button" Margin="4,0,2,0" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}">
<Rectangle Fill="#FFB8B8B8" Stroke="Black" Height="14" Width="14">
<Rectangle.OpacityMask>
<ImageBrush ImageSource="T_ConnectionSettings.png"/>
</Rectangle.OpacityMask>
</Rectangle>
</Button>
Code: Select all
if (RenderDevice* CurrentDevice = ((RenderContext*)RenderView->GetRenderer())->GetDevice())
{ ....... }