开发者

Overlays using streams resizes an image in VB.Net?

开发者 https://www.devze.com 2022-12-15 02:22 出处:网络
As a follow up to this thread I found that the overlay function was working fine. However, it seems that if I use the overlay function while reading an image from a stream, that it would enlarge the

As a follow up to this thread

I found that the overlay function was working fine. However, it seems that if I use the overlay function while reading an image from a stream, that it would enlarge the picture before overlaying it.

ie:

overlay = New Bitmap(stream)
g.DrawImage(overlay, 0, 0)

Seems to enlarge the image before overlaying it, whereas this:

overlay = New Bitmap(My.Resources.Pic)
g.DrawImage(overlay, 0, 0)

Seems to overlay the imag开发者_Go百科e fine.

What could be the reason for this?


It's possible that there is a DPI mismatch that GDI+ is attempting to compensate for.

Right-click on the My.Resources.Pic and choose "Goto Declaration". You should be able to locate the line of generated code that loads it. You can compare that code against how you load the image to see if there are any differences.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号