有没有一种方法来显示一个窗体上的另一个组成部分? [英] Is there a way to show part of one form on another form?

查看:101
本文介绍了有没有一种方法来显示一个窗体上的另一个组成部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表格。所有我想要做的是另一种形式显示了形式的部分。 我不希望它是功能或任何东西。基本上,我只是希望它是一张图片。 这是可能的,如果是的话,怎么办?

I have a form. All I want to do is display a section of that form on another form. I don't want it to be functional or anything. I basically just want it to be a picture. Is that possible, and if so, how?

如同

display = new display(form, new rectangle(X1, X2, Y1, Y2));

那是一种可能性?

Is that a possibility?

推荐答案

是的,你可以这样做:

Bitmap bmp = new Bitmap(myWidth, myHeight);
myForm.DrawToBitmap(bmp, new Rectangle(x, y, bmp.Width, bmp.Height));

和然后此位图传递到其他形式

And then pass this bitmap to the other form.

这篇关于有没有一种方法来显示一个窗体上的另一个组成部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆