Win2D 0.0.18 – vacations, doc improvements and Exif rotation support


What do you get when part of the team is presenting at the Build conference and the other part on vacation?

Not a lot!

<rimshot>

 

Nevertheless, Win2D version 0.0.18 is now available on NuGet and GitHub:

  • Documentation improvements in response to customer feedback
  • CanvasBitmap.LoadAsync now respects Exif rotation metadata, so phone photos appear the right way up

Comments (9)

  1. Andy says:

    Hi there,

    can we write text directly to a bitmapimage (randomaccesstream and/or file) without the Need of any UI? I'm asking because of background-Tasks. Right now I'm calling a C++ Project from my C# WindowsStore App to be able to create text as Image in a backgroundtask. Would be lovley to just use a one-liner with wind2d 😉 On the other Hand I see that you yet have to implement dwrite functionality – so I'm unsure if this is possible at the given time!?

    regards,

    andy

  2. It's not quite a 1-liner, but you can draw to a CanvasRenderTarget (using it's CreateDrawingSession method) with no need for any UI.

  3. Andy says:

    Awesome news. Thanks a lot!

  4. Andy says:

    Hi Shawn,

    sorry to bother again… I'm trying right now to that all by code, but am struggling with a typeloadexception vor CanvasRenderTarget:

    [Code]

    CanvasControl canvasControl = new CanvasControl();

    CanvasRenderTarget renderTarget;

    renderTarget = new CanvasRenderTarget(canvasControl, 400,400, 96);

    The last line will throw the exception… I guess because CanvasControl is not properly created? I tried with the CreateResources Eventhandler but that's not  being fired if setup by code.

  5. Andy,

    I suspect you are seeing issue #59 (github.com/…/59)

    That was due to a bug in VS2013 Update 4, which is fixed in VS2013 Update 5 (and VS2015).

  6. Andy says:

    Seems logic. But I did the update (still no final release, RC tough) and it's still there. I can run your samples Gallery fine btw "Game of life" for example does create new canvasrendertargets… runs fine even with update 4.

  7. Andy says:

    Ok… after several restarts the typeloadexception went magicall away 😉 Now I'm facing the Problem that I Need to create manually a CanvasDevice and also do not know how to manually Trigger the createresources method of the canvas control (if needed).

    So I got this ArgumentException now:

    The control does not currently have a CanvasDevice associated with it. Ensure that resources are created from a CreateResources or Draw event handler.

    Code so far:

    CanvasControl canvasControl = new CanvasControl();

    canvasControl.CreateResources += canvasControl_CreateResources;

    CanvasRenderTarget renderTarget;

    renderTarget = new CanvasRenderTarget(canvasControl, 400, 400, 96);

    static void canvasControl_CreateResources(CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args)

           {

               Debug.WriteLine("canvasControl_CreateResources");

               //throw new NotImplementedException();

           }

    Sorry for spamming here… maybe I should make a thread on the MSDN boards?

  8. If you want a new CanvasDevice without using the full XAML control, just do "new CanvasDevice()'.

    The control will only initialize when it is loaded into a XAML page, so newing one up without loading it into the UI leaves you with a not-yet-initialized control instance.

    > Sorry for spamming here… maybe I should make a thread on the MSDN boards?

    The best place for such conversations is github: github.com/…/issues

    Win2D team isn't currently paying much attention to the MSDN forums, but we will see any issues raised on github and are committed to respond to them promptly.

  9. oneonce says:

    How to rotate the text by specified angle and rotate-point?
    args.DrawingSession.DrawText(“Win2D”, 0, 0, Colors.Red, rotateCenter, rotateAngle);

Skip to main content