Page 1 of 1

RenderOptions not working with ImageBrush

Posted: 25 Aug 2019, 16:14
by asusralis
I'm trying to put an image in a circle, but I can't seem to change the bitmap scaling mode to Nearest Neighbor like I can with regular images.
<Ellipse>
	<Ellipse.Fill>
		<ImageBrush ImageSource="{}" RenderOptions.BitmapScalingMode="NearestNeighbor"/>
	</Ellipise.Fill>
</Ellpise>
If it matters the ImageSource is a TextureSource.

Re: RenderOptions not working with ImageBrush

Posted: 26 Aug 2019, 11:18
by sfernandez
RenderOptions.BitmapScalingMode is only applied to Visual elements so you need to set it in the Ellipse instead:
<Ellipse RenderOptions.BitmapScalingMode="NearestNeighbor">
  <Ellipse.Fill>
    <ImageBrush .../>
  </Ellipse.Fill>
</Ellipse>
Please let me know if this works as you expected.