简体   繁体   中英

Weird glitch with ASP.net drawing

I have a code that draws a few things. At the end, it draws a string. The string looks like it was copied from a text editor -- really nice! But weirdly, when I try to draw exactly same image only 10 pixels wider, the text gets blurry. When I say wider, I only mean like initializing a Bitmap with +10px width. Image still draws on the same area like those 10px were not there.

I already checked measureString. It seems fine. My first thought was that it measures wrong and shrink text width but that can't be case since I'm only passing text and font to measureString.

I already tried drawing the text then copying the whole Image to a new Bitmap only 10px wider (Image again stays the same width, the 10px are just blank space) but exactly same thing happens. I have way too much code to post it all. Any suggestions as to what could be the problem?

Example:

在此处输入图片说明

Thanks

您最有可能忘记了后期宽度限制,该限制会阻止最终图片正确扩展宽度:在“调整大小”的示例中,所绘制的文本正在缩小 ,因此逻辑上(以及“调整大小”示例),则表明您实际上是在尝试将同一区域的图片更宽。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM