日期:2014-05-18 浏览次数:21568 次
using System.IO; using System.Drawing.Imaging; using System.Drawing; namespace ControlBean { public class GetStream : MarshalByRefObject, IGetIMG { public MemoryStream GetImageStream() { CatScreen screen = new CatScreen(); Image img = screen.GetScreenImage(); MemoryStream ms = new MemoryStream(); img.Save(ms, ImageFormat.Jpeg); return ms; } } }
------解决方案--------------------
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication71 { public partial class Form1 : Form { List<RadioButton> CheckRadioButtons = new List<RadioButton>(); public Form1() { InitializeComponent(); radioButton1.CheckedChanged += new EventHandler(CheckedChanged); radioButton2.CheckedChanged += new EventHandler(CheckedChanged); radioButton3.CheckedChanged += new EventHandler(CheckedChanged); radioButton4.CheckedChanged += new EventHandler(CheckedChanged); } void CheckedChanged(object sender, EventArgs e) { RadioButton RB = (RadioButton)sender; if (!RB.ContainsFocus) return; if (!CheckRadioButtons.Contains(RB)) CheckRadioButtons.Add(RB); foreach (RadioButton RB2 in CheckRadioButtons) if (RB2 != RB) RB2.Checked = false; } } }