5、6. 7. /// 8. /// Create and apply the region on the supplied control 9. /// 创建支持位图区域的控件(目前有button和form) 10. /// 11. /// The Control object to apply the region to控件 12. ///
6、"bitmap">The Bitmap object to create the region from位图 13. public static void CreateControlRegion(Control control, Bitmap bitmap) 14. { 15. // Return if control and bitmap are null 16. //判断是否存在控件和位图 17. if (control == nu
7、ll
8、
9、 bitmap == null) 18. return; 19. 20. // Set our control''s size to be the same as the bitmap 21. //设置控件大小为位图大小 22. control.Width = bitmap.Width; 23. control.Height = bitmap.Height; 24. // Check if we are d
10、ealing with Form here 25. //当控件是form时 1. if (control is System.Windows.Forms.Form) 2. { 3. // Cast to a Form object 4. //强制转换为FORM 5. Form form = (Form)c