locked
Set Default Font on Graphics object RRS feed

  • Question

  • User77689304 posted

    Hi,

    I'm writing library that read Microsoft Math Equation Objects from RFT and then extract them as JPGs.

    Here's my code:

    Image image = Image.FromStream(gPictureData, true, true);

    Bitmap bmp = new Bitmap(dx, dy); // dx is the picture width, dy is the picture height, they're ok

    Graphics gr = Graphics.FromImage(bmp);

    gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
    gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
    gr.Clear(Color.White);

    Rectangle bmpRect = new Rectangle( 0, 0, dx, dy );

    gr.DrawImage(image, bmpRect);

    bmp.Save(fname, System.Drawing.Imaging.ImageFormat.Jpeg);


    The formula text is drawn in the image but with huge font. Is it possible to set some default font size of the Griphic object?


    Thanks in advance for all replies

    Saturday, September 19, 2009 2:49 AM

Answers