问题描述
你好!所以我得到了这个项目,制作一个像应用程序一样的颜料。应用程序必须加载和映像,并且必须能够在该图像上绘制。
这会加载图像并进行编辑以进行编辑:
这样可以在图片框上绘图:
这会禁用图片框上的绘图:
这就是图纸
这是drawMyine函数:
我的问题如下:一切都很好,除非我绘制,绘图不会从光标所在的位置开始,如果我改变
绘图开始它应该(在光标位置)但是如果我使用
如果我正在加载它的图像大于picturebox4宽度并且高度看起来它看起来被裁剪。我可以使用
PictureBoxSizeMode.Autosize
但是图片不应该有任何滚动条可见因此我必须使用缩放,因为它适合里面的图像图片框。有人可以帮我弄清楚如何在放大的图像上正确绘制?谢谢!
P.S.如果你有什么不明白的地方请告诉我。
现在在form_load事件中添加这个
Picturebox1只是一个例子用你的图片框替换它
现在你单击我的情况下的保存按钮它是另一个图片框(你可以使用一个按钮)添加到click事件
我希望在阅读本文时不会有任何误解。再次感谢您的回复。
hello !
so i got this project , to make a paint like application . The Application must load and image and one must be able to draw on that image .
This loads the image and preps it for editing :
This enables drawing on the picturebox :
This disables the drawing on the picturebox :
And this does the drawing
This is the drawMyine function :
My problem is the following : Everything works great except when i draw , the drawing does not start where the cursor is ,if i change
the drawing start where it's supposed to (at the cursor position) but if i use
and if the image i'm loading it's bigger than the picturebox4 width and heigh it looks cropped .I could use
but the image should not have any scrollbars visible so that why i must use zoomed because it fits the image inside the picturebox. Can someone help me figure out how to draw properly on zoomed images ? Thank you !
P.S. if there is something you did not understand please let me know .
Now in form_load event add this
Picturebox1 is just an example replace it with your picturebox
Now when you click the save button in my case it's another picturebox (you could use a button) add this to the click event
I hope there will be no misunderstandings when reading this . Enjoy and thank you for your replies once again.
这篇关于vb.net在缩放图像上绘图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!