- DigitalKarnage
- Posts: 22
- Joined:
[C++] Access Violation When Setting ImageSource on Rectangle Opacity
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())
{ ....... }
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: [C++] Access Violation When Setting ImageSource on Rectangle Opacity
Hi,
I guess that RenderView variable is the object returned by Noesis::GUI::CreateView function. In that case, if you call RenderView->GetRenderer() that will return a Noesis::IRenderer* object instead of the Noesis::RenderContext* class you are specifying.
The RenderDevice is something you have provided during initialization, so you should have access to that object without using the IView or IRenderer.
Kind regards.
I guess that RenderView variable is the object returned by Noesis::GUI::CreateView function. In that case, if you call RenderView->GetRenderer() that will return a Noesis::IRenderer* object instead of the Noesis::RenderContext* class you are specifying.
The RenderDevice is something you have provided during initialization, so you should have access to that object without using the IView or IRenderer.
Kind regards.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 15 guests