If I want better performance in doing a simple annotation, is it accurate to say that I should be using Direct2D instead of GDI+ under Windows 7?
I am writing a C# console application. At one point, it is currently using System.Drawing.Graphics (which is GDI+ essentially) to do the annotation, like this:
using (Graphics g = Graphics.FromImage(bm))
using (SolidBrush solidWhiteBrush = new SolidBrush(Color.White))
using (SolidBrush solidBlackBrush = new SolidBrush(Color.Black))
// Write out annotation text
g.FillRectangle(solidWhiteBrush, 0, 0, bm.Width, bm.Height);
g.DrawString(AnnotationText, AnnotationFont, solidBlackBrush, new PointF(7f, 2f));
Is there a faster way to be doing this?
What would be the "Direct2D" way to write these 2 lines of code, specifically:
Brush, 0, 0, bm.Width, bm.Height);
t, AnnotationFont, solidBlackBrush, new PointF(7f, 2f));
And what libraries do I need to include to get to the Direct2D methods?