DigitalKarnage
Topic Author
Posts: 22
Joined: 09 Dec 2013, 18:45

[C++] Access Violation When Setting ImageSource on Rectangle Opacity

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
<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>
if (RenderDevice* CurrentDevice = ((RenderContext*)RenderView->GetRenderer())->GetDevice())
{ ....... } 
 
User avatar
sfernandez
Site Admin
Posts: 1778
Joined: 22 Dec 2011, 19:20

Re: [C++] Access Violation When Setting ImageSource on Rectangle Opacity

07 Aug 2018, 21:09

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.

Who is online

Users browsing this forum: Bing [Bot] and 12 guests