Zoom, DocScale

hi.

how can I set DocScale individually(vertical scale and horizontal scale)

I need a fit mode according to the document size.

I already saw the drawDemo examples. ( RescaletoFit() method )
however, It also sets the horizontal and vertical zoom scale at the same time.(using DocScale property)

I just want to set zoom scale seperately.


class MyView : GoView
{
void Fit()
{
Size displaySize = this.DisplayRectangle.Size;
RectangleF doc = new RectangleF(0, 0, this.DocumentSize.Width, this.DocumentSize.Height);

            float newscale = 1.0f;
            if (doc.Width > 0 && doc.Height > 0)
            {
                newscale = Math.Min(displaySize.Width / doc.Width, displaySize.Height / doc.Height);
            }

            this.DocScale = newscale;
}

...

public override float DocScale
    {
        get
        {
            return base.DocScale;
        }

        set
        {
            base.DocScale = (float)value;
        }
    }

}

please, would you give me some example codes and advices.

thank you.

There’s an undocumented (unsupported) way to do this. I’ll send you an email.