using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using DevExpress.XtraEditors; using DevExpress.XtraEditors.Repository; using XdCxRhDW.Core; using XdCxRhDW.Core.Api; namespace XdCxRhDW.App.CorTools { public partial class CgImageForm : DirectXForm// DevExpress.XtraEditors.XtraForm { public CgImageForm() { InitializeComponent(); this.Font = new Font("微软雅黑", 12); } List list; public CgImageForm(List list) :this() { this.list= list; } private void CgImageForm_Load(object sender, EventArgs e) { directXFormContainerControl1.Location = new Point(1, 40); Bitmap bmp = new Bitmap(1024, 768); for (int x = 0; x < 1024; x++) { for (int y = 0; y < 768; y++) { var rgbb = ColorRGB.GetSpecColor(x / 1023d); int r = rgbb.R; int g = rgbb.G; int b = rgbb.B; Color c = Color.FromArgb(r, g, b); bmp.SetPixel(x, y, c); } } var edit = (RepositoryItemPictureEdit)this.pic.Edit; edit.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Stretch; this.pic.EditValue= bmp; } } }