title: SharpDX Direct2D DrawBitmap smooth image
body: <p>Does anyone know how to smooth out the edges on these two yellow figures below? Also below is the original image. </p>
  
  <p>Here's the code to load BMP from disk.</p>
  
  <pre><code>static BitmapSource LoadBitmap(ImagingFactory _wicFactory, string path, ImageFormat imageFormat)
  {
      SharpDX.WIC.BitmapDecoder decoder = new SharpDX.WIC.BitmapDecoder(
              _wicFactory,
              path,
              SharpDX.WIC.DecodeOptions.CacheOnDemand);
  
      var formatConverter = new SharpDX.WIC.FormatConverter(_wicFactory);
      formatConverter.Initialize(
              decoder.GetFrame(0),
              SharpDX.WIC.PixelFormat.Format32bppPBGRA,
              SharpDX.WIC.BitmapDitherType.DualSpiral8x8,
              null,
              0.0,
              SharpDX.WIC.BitmapPaletteType.Custom);
  
      return formatConverter;
  }
  </code></pre>
  
  <p>Code to draw the image</p>
  
  <pre><code>var wicBitmap = new WicBitmap(_wicFactory, options.ImageSize.Width, options.ImageSize.Height, SharpDX.WIC.PixelFormat.Format32bppPBGRA,
      BitmapCreateCacheOption.CacheOnLoad);
  var renderTargetProperties = new RenderTargetProperties(RenderTargetType.Default, new D2DPixelFormat(Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied),
      0, 0, RenderTargetUsage.None, FeatureLevel.Level_DEFAULT);
  var renderTarget = new WicRenderTarget(_ddFactory, wicBitmap, renderTargetProperties);
  renderTarget.AntialiasMode = AntialiasMode.Aliased;
  var bitmapSource = LoadBitmap(_wicFactory, @"C:\fanv_elev.bmp", ImageFormat.Bmp);
  var formatConverter = new FormatConverter(_wicFactory);
  formatConverter.Initialize(bitmapSource, SharpDX.WIC.PixelFormat.Format32bppPBGRA, BitmapDitherType.Spiral8x8, null, 0f, BitmapPaletteType.MedianCut);
  SharpDX.Direct2D1.Bitmap direct2DBitmap = SharpDX.Direct2D1.Bitmap.FromWicBitmap(bitmapRenderTarget, formatConverter);
  </code></pre>
  
  <p>...</p>
  
  <pre><code>renderTarget.DrawBitmap(direct2DBitmap, featureRect, 1.0f, SharpDX.Direct2D1.BitmapInterpolationMode.Linear);
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/nZDKA.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/J2ZU8.png" alt="enter image description here"></p>