Get cell rect after zoom in FunctionVisualizer PaintCell

Posted by: niels on 20 May 2023, 7:39 am EST

    • Post Options:
    • Link

    Posted 20 May 2023, 7:39 am EST

    The rect has the size of the unzoomed cell,

    how to get the size of rect after zoom?

    protected override void PaintCell(

    Graphics graphics,

    Rectangle rect,

    object cellValue,

    ref StyleFormat styleFormat,

    IWorksheet worksheet)

  • Posted 21 May 2023, 6:02 pm EST

    it is in worksheet.View.ZoomScale

  • Posted 22 May 2023, 12:08 am EST

    Hi Niels,

    Unfortunately, we could not replicate the issue on our end. We have attached a sample application showing the implementation for your reference. Please see ZoomCellRectSize.zip

    To further investigate the problem, we kindly request you to update the provided sample application so that we can replicate the issue on our end. Alternatively, if possible, please send us a stripped-down version of the sample application that replicates the issue on your end.

    Thanks & Regards,

    Aastha

  • Posted 22 May 2023, 1:01 am EST

    Thanks Aastha. Strange that it works for you.

    For me it works after multiplying the rect with worksheet.View.ZoomScale

  • Posted 22 May 2023, 3:32 pm EST

    Hi Niels,

    It’s quite strange that you have to consider a workaround to achieve the required behavior. On our end, it is showing the correct behavior with all versions of Spread.NETv16.

    Kindly let us know if you have any further concerns regarding this.

    Best Regards,

    Aastha

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels