帮助显示和隐藏C#中的图片 [英] Help with display and hide pictures in C#
问题描述
我有一个显示背景图片的程序,我想设置该图片的一个小区域,就像我用鼠标在该区域中单击以在背景图片上的其他位置显示另一个小图片,然后当我再次点击该区域时,隐藏上一次点击显示的小图片。
换句话说,我希望点击的区域有点击与我想要出现和消失的图片无关,在另一个地方。
帮助这里的人们
谢谢
我的尝试:
什么都没有然而
I have a program that displays a background picture and I want to set a small area of that picture as when I click in that area with the mouse to display an other small picture in an other place over the background picture, and then when i click again in that area, to hide the small picture that displayed with the previous click.
With other words that area that i want to be active on click has nothing to do with the picture that i want to appear and disappear, is in another place.
Help here guys
Thanks
What I have tried:
nothing yet
nothing yet
nothing yet
推荐答案
只是做它,很简单。记录鼠标单击的位置,发出重绘,在背景上绘制(或不绘制)小图像。例如,参见 .net - 如何使用图形库C#在图像上绘制小图像? - 堆栈溢出 [ ^ ]。
Just do it, It is plain simple. Record the position of the mouse click, issue a repaint, drawing (or not) the small image over the background one. See, for instance .net - How can I draw a small image over an image using Graphics library C# ? - Stack Overflow[^].
这篇关于帮助显示和隐藏C#中的图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!