Win2D 1.11.0 – text analysis, block compressed bitmaps, saving large images, and IBuffer pixel access


Win2D version 1.11.0 is now available on NuGet (for Windows 10 or Windows / Phone 8.1) and GitHub.

New in this release:

  • CanvasTextAnalyzer identifies what glyphs are needed to render a piece of text, including the font fallbacks to properly handle different languages.  Example Gallery uses this to create a new Custom Text Layouts example, which wordwraps text to fill an arbitrary geometric shape:

 

 

  • Win2D now supports block compressed bitmap formats, which can be loaded from DDS files via CanvasBitmap.LoadAsync.
  • Added CanvasImage.SaveAsync, which is useful for two reasons:
    • Unlike CanvasBitmap.SaveAsync, this can save any ICanvasImage, which is handy if you want to save out a command list or image effect without bothering to draw it into a rendertarget first.
    • It can save images larger than the maximum bitmap size supported by the current GPU. The implementation will automatically split up the image into multiple smaller pieces, and tile its operations as needed to make this work.

Comments (7)

  1. I forgot to mention – we also made some size optimizations to shrink the install and memory footprint of the Win2D DLL.

  2. juanpablogc says:

    Win2D is now a really complete environment to make interesting apps, I've decided to begin one because I need an app that does not exists as it should for another app I am preparing :). So thank you a lot for this great effort and patience.  (About the alpha from OpenCV I follow your advice and I solve that using c# and BitmapEncoder). Thanks for all and the new implementations.

  3. juanpablogc says:

    Is possible to apply scale to a CanvasControl avoiding Antialising? I have made a tiled effect image that is a really awesome feature (people uses lot of crazy alternatives). But when I make for instance a ScaleTransform to that appears that blurriness. Might be I have to use Composition? Thanks

  4. If you want scaled image to appear pixelated rather than filtered, specify CanvasImageInterpolation.NearestNeighbor rather than the default CanvasImageInterpolation.Linear.

    Where to put that depends on what API you are using to do the scaling.  Pretty much everywhere in Win2D that can transform an image also includes an option to specify a CanvasImageInterpolation mode.

  5. Chris says:

    DDS support? 'Tis the season!

    CanvasImage.SaveAsync might be a great convenience as well.

    Thanks for the update and hope you had a nice Christmas. 🙂

  6. Bill Henning [Actipro] says:

    Shawn, do you have any hints on how to create a customer IBuffer for use with some of those new CanvasBitmap method overloads that take IBuffer?  It would be nice to be able to support a way to dynamically supply bytes in scenarios where the bitmap pixel data is minimal compared to the bitmap size instead of having to maintain a full byte array.  For instance, if only one pixel is colored in a 100×100 bitmap, it would be nice to have a customized IBuffer data structure to handle that instead of storing a 100x100x4 size byte array.  But the MSDN docs on IBuffer are pretty lacking since they only indicate Capacity and Length properties.  I'm not sure how you make a byte accessor for a custom IBuffer.

  7. All implementations of the WinRT IBuffer interface are also required to implement the pure COM IBufferByteAccess, which is how the underlying data is accessed.

    But you can't use this for the scenario you describe here.  IBuffer is just an abstraction over an array of bytes, not a streaming type interface – you need to have all the bytes available at the same time in a single contiguous block of memory.

Skip to main content