-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Bug: FillPath and DrawPath do not work on Memory Bitmap #81
Comments
Someone an idea? Thanks. |
I tested your code, and I didn't see any problems there. Just noticed that there is no What problem do you get? m_MemoryBitmap = Device.CreateBitmapGraphics(ClientRectangle.Width, ClientRectangle.Height);
...
m_MemoryBitmap.BeginRender();
foreach (var pie in pies)
{
// draw pie geometries
m_MemoryBitmap.FillPath(pie.path, D2DColor.Randomly());
m_MemoryBitmap.DrawPath(pie.path, D2DColor.Randomly(), 2);
}
//m_MemoryBitmap.FillPathWithBrush(pies[0].path, brush);
m_MemoryBitmap.EndRender();
g.DrawBitmap(m_MemoryBitmap, ClientRectangle); |
Same issue (on .NET6,7,8,9)
|
@jingwood It seems that since the Path is created from the Device handle via D2DDevice.CreatePathGeometry(), when you call D2DGraphics.DrawPath() it is drawing onto the original D2DDevice D2DGraphics instead of the graphics from D2DDevice.CreateBitmapGraphics. In the image below, The Rectangle is the memory bitmap. DrawText() and DrawPath() is called with left=0, top=0 and renders correctly inside the memory bitmap's 0,0. However, the path is drawn at the form's 0,0 instead. |
Hi,
I need to draw thousand of pie Elements on my RenderContext. Because the calculation is very time consuming, I need to draw them on a memory bitmap and the the memory bitmap on screen.
But this don't work, simply it's nothing drawn but also no error or exception.
I modified your PieChart Example to demonstrate the issue. All other methods work excelent on memory bitmap, but FillPath and DrawPath will not (I've not tested more).
Can you please fix this?
Regards
The text was updated successfully, but these errors were encountered: