locked
BitmapFrame

    Question

  • Hi,

    I'm trying to convert the code below into Win 8.1 .Does anyone now how to .Thank you.

               int columns=6;
               int rows=4;

                var rectBlank = new Rectangle();
                rectBlank.Width = columns * 100;
                rectBlank.Height = rows * 100;
                rectBlank.HorizontalAlignment = HorizontalAlignment.Left;
                rectBlank.VerticalAlignment = VerticalAlignment.Top;
                rectBlank.Fill = new SolidColorBrush(Colors.White);
                rectBlank.Arrange(new Rect(0, 0, columns * 100, rows * 100));

              var bi = new BitmapImage(new Uri(srcFileName));
              RenderTargetBitmap rtb = new RenderTargetBitmap((columns + 1) * 100, (rows + 1) * 100, bi.DpiX,  bi.DpiY,     PixelFormats.Pbgra32);
                rtb.Render(rectBlank);
                PngBitmapEncoder png = new PngBitmapEncoder();
                png.Frames.Add(BitmapFrame.Create(rtb));
                Stream ret = new MemoryStream();
                png.Save(ret);

    Thursday, December 11, 2014 5:36 PM

Answers

All replies