gpt4 book ai didi

c# - 如何将控件的外观转换为图像?

转载 作者:行者123 更新时间:2023-12-04 02:50:43 25 4
gpt4 key购买 nike

我希望用户能够拖动 Control在展示的同时。我似乎无法找到将其外观转换为图像的方法(以便将该图像转换为图标以便将其作为拖动图标)。

最佳答案

如果我理解正确,您想将控件绘制到图像上吗?使用 Control.DrawToBitmap :

Bitmap b = new Bitmap(myControl.Width, myControl.Height);
myControl.DrawToBitmap(b, new Rectangle(0, 0, b.Width, b.Height));

关于c# - 如何将控件的外观转换为图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10180129/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com