Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (1 posts)

direct2d: getting hresult 0x88990001 from PathGeometry object

Last post 12/4/2017 12:46 PM by hljlishen. 0 replies.
  • 12/4/2017 12:46 PM

    direct2d: getting hresult 0x88990001 from PathGeometry object

    I'm getting a hresult 0x88990001 Exception everytime I draw a PathGeometry.
    code is :
        BeginDraw();
                factory = D2DFactory.CreateFactory();
                PathGeometry pg;
                pg = factory.CreatePathGeometry();
                Microsoft.WindowsAPICodePack.DirectX.Direct2D1.Brush b = canvas.CreateSolidColorBrush(new ColorF(255));
                GeometrySink gs = pg.Open();
                gs.SetFillMode(FillMode.Winding);
                gs.BeginFigure(new Point2F(0, 0), FigureBegin.Filled);
                Point2F[] p = { new Point2F(100, 100), new Point2F(0, 100) ,new Point2F(0,0)};
                gs.AddLines(p);
                gs.EndFigure(FigureEnd.Closed);
                canvas.DrawGeometry(pg, b, 3);
        EndDraw();
    I discover that properties FigureCount and SegmentCount of pg throw a ComException immediately after pg = factory.CreatePathGeometry();
    How can I fix this ? thx

Page 1 of 1 (1 posts) Previous Discussion Next Discussion