Is there anyway to retrieve a "System.Drawing.Graphics" object that's already instantiated withing an ASPX (page, request, etc)?
Not sure if it's entirely relevant, but it seems the usual method is to get "Graphics" from some call of "Graphics.From*".
ie:
Bitmap bmp = new Bitmap(1,1);
Graphics gfx = Graphics.FromImage(bmp);
However, since the size of the string isn't known until a call to "Graphics.MeasureString" it would require to then throw away the first "Bitmap" before creating a new one. Is this accepted practice in .Net? Or, read above, for my "thought".
renameus1234
0 Points
1 Post
Acquiring Graphics from Web Context?
Dec 07, 2011 01:36 AM|LINK
Is there anyway to retrieve a "System.Drawing.Graphics" object that's already instantiated withing an ASPX (page, request, etc)?
Not sure if it's entirely relevant, but it seems the usual method is to get "Graphics" from some call of "Graphics.From*".
ie:
Bitmap bmp = new Bitmap(1,1);
Graphics gfx = Graphics.FromImage(bmp);
However, since the size of the string isn't known until a call to "Graphics.MeasureString" it would require to then throw away the first "Bitmap" before creating a new one. Is this accepted practice in .Net? Or, read above, for my "thought".
Thanks!