【问题标题】:Move the BitMap image in OnMouseMove of a control在控件的 OnMouseMove 中移动位图图像
【发布时间】:2017-06-14 00:35:57
【问题描述】:

我是 Windows 窗体的新手,我有一个位图图像,我需要在鼠标移动时移动我的位图图像,而不是将位图添加到 PictureBox 中。

提前致谢。

问候,

法雅娜

【问题讨论】:

    标签: winforms mouseevent


    【解决方案1】:

    您可以使用 GDI+ 库来完成。您可以像 win32 api 一样使用 onpaint 函数来完成。我不是专家,但希望线索有效...示例线索..

    Bitmap bmp=new Bitmap("pic.jpg");
    e.Graphics.DrawImage(bmp,150,150);
    

    显示位图后,您可以通过添加更多编码将其移动到客户区。

    【讨论】:

      猜你喜欢
      • 2014-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-31
      • 2016-04-03
      • 2018-11-12
      • 2011-04-12
      • 1970-01-01
      相关资源
      最近更新 更多