L
Lance
Hi,
Sorry for the confusing subject, but here is what I am after: I am using
the 'System.Drawing.FontStyle' object, and I would like the caller of the
function to be able to decide when calling the function what style to use.
Hmm even more confusion, methinks. Here is some pseudocode for what I want
to do:
//calling the function
CreateGifImage("Bold");
//function to call
public static string CreateGifImage( string sFontStyle)
{
....
Font MyFont = new Font( sFont, pxSize,
System.Drawing.FontStyle.(sFontStyle),
System.Drawing.GraphicsUnit.Pixel );
....}
So the caller just passes in a string that matches up to an actuall
fontstyle, and MyFont is happily created. I'm looking for an alternative
to:
Font MyFont = new Font( sFont, pxSize,
(sFontStyle == "bold" ? System.Drawing.FontStyle.Bold :
System.Drawing.FontStyle.Regular),
System.Drawing.GraphicsUnit.Pixel );
Thanks,
Lance
Sorry for the confusing subject, but here is what I am after: I am using
the 'System.Drawing.FontStyle' object, and I would like the caller of the
function to be able to decide when calling the function what style to use.
Hmm even more confusion, methinks. Here is some pseudocode for what I want
to do:
//calling the function
CreateGifImage("Bold");
//function to call
public static string CreateGifImage( string sFontStyle)
{
....
Font MyFont = new Font( sFont, pxSize,
System.Drawing.FontStyle.(sFontStyle),
System.Drawing.GraphicsUnit.Pixel );
....}
So the caller just passes in a string that matches up to an actuall
fontstyle, and MyFont is happily created. I'm looking for an alternative
to:
Font MyFont = new Font( sFont, pxSize,
(sFontStyle == "bold" ? System.Drawing.FontStyle.Bold :
System.Drawing.FontStyle.Regular),
System.Drawing.GraphicsUnit.Pixel );
Thanks,
Lance