我当前的代码允许我从用户定义的点绘制矩形,但不是以我想要的方式。我需要它像你在画图中做的那样,这是我当前的代码:
命名空间SimpleDraw2 {/ MainForm的描述。/公共分部类MainForm : Form { bool IsMouseDown = false;Point MousePosition;int DrawShape = 0;位图StoredImage;
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms
我已经在我的窗体中实现了一个图片框,我甚至实现了滚动条来使图像适合it.so现在的问题是,当我尝试向下滚动按钮时,它会向下滚动,当我离开鼠标时,按钮立即向上滚动..here是实现的代码请提供一些建议。
public void DisplayScrollBars()
{
// If the image is wider than the PictureBox, show the HScrollBar.
if (pictureBox1.Width > pictureBox1.Image.Width - this.vScrollBar1.Wid
有人看到我的错误了吗?
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
Dim renderer As VisualStyleRenderer
renderer = New VisualStyleRenderer(VisualStyleElement.Button.PushButton.Normal)
Dim nRect As New Rectangle
nRect = Rectangle.FromLTRB(0, 0, 1
我正在编写用于查看地图的简单C#应用程序。地图是大小约为1000x1000的JPG图像,可以按比例调整大小。我有一组点坐标(x,y)和名称。查看器是一个带有控制面板和PictureBox的窗口窗体应用程序。PictureBox具有属性SizeBox=AutoSize。我使用这种方法将点放置到地图上(PictureBox)。
Graphics g = Graphics.FromHwnd(pictureBox.Handle);
SolidBrush redBrush = new SolidBrush(Color.Red);
g.FillEllipse(redBrush, x, y, 7, 7);
首先,我为我糟糕的英语感到抱歉。现在,我的C#项目( ms paint)遇到了问题。当我打开新的“图片中的图片”框时,我绘制的最后一个形状仍然保留,直到我在此图像上绘制另一条线。下面是我的代码:
-Draw行:
public Form1()
{
InitializeComponent();
snapshot = new Bitmap(pictureBox1.Width, pictureBox1.Height);
}
if (tempDraw != null)
{
tem