asusralis
Topic Author
Posts: 142
Joined: 30 Jul 2018, 05:03

RenderOptions not working with ImageBrush

25 Aug 2019, 16:14

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.
 
User avatar
sfernandez
Site Admin
Posts: 2995
Joined: 22 Dec 2011, 19:20

Re: RenderOptions not working with ImageBrush

26 Aug 2019, 11:18

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.

Who is online

Users browsing this forum: Ahrefs [Bot] and 24 guests