protected override void OnDrawItem(DrawItemEventArgs ea) { ea.DrawBackground(); ea.DrawFocusRectangle(); if (imageList != null) { ComboBoxExItem item; Size imageSize = imageList.ImageSize; Rectangle bounds = ea.Bounds; try { item = (ComboBoxExItem)Items[ea.Index]; if (item.ImageIndex != -1) { ImageAttributes attr = new ImageAttributes(); Color color = System.Drawing.ColorTranslator.FromHtml("#425B8C"); ColorMatrix cm = GraphEngine.get_colormatrix(color); attr.SetColorMatrix(cm); Image image = ImageList.Images[item.ImageIndex]; ea.Graphics.DrawImage(image, new Rectangle(bounds.Left, bounds.Top, image.Width, image.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attr); } } catch { } } base.OnDrawItem(ea); }
private void Scene_Paint(object sender, PaintEventArgs e) { GraphEngine.paint_meter(e.Graphics, e, this.Scene); // paint the graphs }