Cropping images sometimes a wrong area

后端 未结 1 1457
情歌与酒
情歌与酒 2020-12-21 22:39

I\'m using jQuery-cropbox to crop images on a web application.

Everything is running smoothly most of the time, but from time to time, the generated image is wrong,

相关标签:
1条回答
  • 2020-12-21 23:26

    Your image (as posted) has 72dpi; your screen and therefore the Graphics you use probably have 96dpi.

    This will lead to the effect you see.

    To avoid the effect simply set the resolution of img before drawing it to the one in your Graphics object:

    img.SetResolution((int)g.DpiX, (int)g.DpiY);
    
    0 讨论(0)
提交回复
热议问题