Here are the examples of the csharp api class System.Windows.Forms.ControlPaint.DrawImageDisabled(System.Drawing.Graphics, System.Drawing.Image, int, int, System.Drawing.Color) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
50 Examples
0
1. Example
View licensepublic void DisabledState(Graphics g, Rectangle bounds, Color bgColor) { using (Bitmap bmp = new Bitmap(Image,bounds.Size)) { ControlPaint.DrawImageDisabled(g, bmp, bounds.X, bounds.Y, Color.Red); } }
0
2. Example
View licensepublic override Rectangle DrawGridErrorGlyph(RenderContext context, Rectangle cellRect, PaletteState state, bool rtl) { Debug.Assert(context != null); // Get the appropriate each to draw Image errorImage = _gridErrorIcon.Images[0]; // Is there enough room to draw the image? if ((errorImage.Width < cellRect.Width) && (errorImage.Height < cellRect.Height)) { // Find the drawing location of the image int y = cellRect.Top + (cellRect.Height - errorImage.Height) / 2; int x = (rtl ? cellRect.Left : cellRect.Right - errorImage.Width); if (state == PaletteState.Disabled) ControlPaint.DrawImageDisabled(context.Graphics, errorImage, x, y, Color.Empty); else context.Graphics.DrawImage(errorImage, x, y); // Reduce the cell rect by that used up cellRect.Width -= errorImage.Width; // With rtl we need to move across to the right if (rtl) cellRect.X += errorImage.Width; } return cellRect; }
0
3. Example
View licensepublic override void Render(Graphics g, Rectangle r) { DrawBackground(g, r); /n ..... /n //View Source file for more details /n }
0
4. Example
View licenseprotected static void DrawImage(Graphics g, DrawState state, Image image, int x, int y) { if (state == DrawState.Normal) g.DrawImage(image, x, y, image.Width, image.Height); else if (state == DrawState.Disabled) ControlPaint.DrawImageDisabled(g, image, x, y, SystemColors.Control); else if (state == DrawState.Focused || state == DrawState.Hover) { ControlPaint.DrawImageDisabled(g, image, x + 1, y, SystemColors.Control); g.DrawImage(image, x - 1, y - 1, image.Width, image.Height); } }
0
5. Example
View licenseprivate static void DrawImage(Graphics g, DrawState state, Image image, int x, int y) { if (state == DrawState.Normal) g.DrawImage(image, x, y, image.Width, image.Height); else if (state == DrawState.Selected || state == DrawState.Hover) { ControlPaint.DrawImageDisabled(g, image, x + 1, y, SystemColors.Control); g.DrawImage(image, x - 1, y - 1, image.Width, image.Height); } }
0
6. Example
View licenseprotected override void OnRenderItemImage(ToolStripItemImageRenderEventArgs e) { var g = e.Graphics; if (e.Image == null) return; if (e.Item.Enabled) g.DrawImageUnscaled(e.Image, new Point(e.ImageRectangle.Left, e.ImageRectangle.Top)); else ControlPaint.DrawImageDisabled(g, e.Image, e.ImageRectangle.Left, e.ImageRectangle.Top, Color.Transparent); }
0
7. Example
View licensepublic override void DrawImage(TreeListView.Node node, Graphics gfx, Rectangle bounds) { // No image to draw if (node.ImageIndex == -1) return; if (Owner.ImageList == null) return; if (node.ImageIndex >= Owner.ImageList.Images.Count) return; if (Owner.Control.Enabled && IsProjectFileOrDirectory(node)) { Owner.ImageList.Draw(gfx, bounds.X, bounds.Y, bounds.Width, bounds.Height, node.ImageIndex); } else { using (var image = Owner.ImageList.Images[node.ImageIndex]) { ControlPaint.DrawImageDisabled(gfx, image, bounds.X, bounds.Y, Owner.DisabledBackColor); } } }
0
8. Example
View licensepublic virtual void DrawImage(ImageList imageList, Graphics g, int x, int y, int index) { if ((Owner == null) || (Owner.Enabled)) { using (var image = imageList.Images[index]) g.DrawImage(image, x, y); } else { using (var image = imageList.Images[index]) ControlPaint.DrawImageDisabled(g, image, x, y, Owner.BackColor); } }
0
9. Example
View licensepublic virtual void DrawImage(Node node, Graphics gfx, Rectangle bounds) { // No image to draw if (node.ImageIndex == InvalidImageIndex) return; if (Owner.ImageList == null) return; if (node.ImageIndex >= Owner.ImageList.Images.Count) return; // intentionally not using Owner.ImageList.Draw() any more due to rogue // pixels that show up if the image size doesn't match the bounds size using (Image image = Owner.ImageList.Images[node.ImageIndex]) { if (Owner.Control.Enabled) gfx.DrawImage(image, bounds); else ControlPaint.DrawImageDisabled(gfx, image, bounds.X, bounds.Y, Owner.DisabledBackColor); } }
0
10. Example
View licensepublic virtual void DrawStateImage(Node node, Graphics gfx, Rectangle bounds) { // No image to draw if (node.StateImageIndex == InvalidImageIndex) return; if (Owner.StateImageList == null) return; if (node.StateImageIndex >= Owner.StateImageList.Images.Count) return; // intentionally not using Owner.StateImageList.Draw() any more due to // match DrawImage behavior. see comment in DrawImage. using (Image image = Owner.StateImageList.Images[node.StateImageIndex]) { if (Owner.Control.Enabled) gfx.DrawImage(image, bounds); else ControlPaint.DrawImageDisabled(gfx, image, bounds.X, bounds.Y, Owner.DisabledBackColor); } }
0
11. Example
View licenseprivate void DrawImage(Graphics g,Image _Image,Point pt) { ImageAttributes ia = new ImageAttributes(); if (currentState == CustomButtonState.Hot) { ia.SetColorMatrix(SkinInfo.HoverColorMatrix); } if (this.Enabled) { g.DrawImage(Image, new Rectangle(pt,_Image.Size), 0, 0, Image.Width, Image.Height, GraphicsUnit.Pixel, ia); } else ControlPaint.DrawImageDisabled(g, _Image, pt.X, pt.Y, SkinInfo.BackColor); }
0
12. Example
View licenseprivate void DrawImage(Graphics g, Image image, Point pt, bool enabled,ColorMatrix colMat) { if (enabled) { ImageAttributes ia = new ImageAttributes(); if (colMat == null) colMat = new ColorMatrix(); if (this.Lock) { ColorMatrix cm = colMat; cm.Matrix33 *= 0.3f; ia.SetColorMatrix(cm); } else ia.SetColorMatrix(colMat); g.DrawImage(image, new Rectangle(pt, new Size(image.Width, image.Height)), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, ia); // g.DrawImage(image, pt); } else ControlPaint.DrawImageDisabled(g, image, pt.X, pt.Y, SkinInfo.BackColor); }
0
13. Example
View licenseprotected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates elementState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) { if (!Show) { using (Brush b = new SolidBrush(Selected ? cellStyle.SelectionBackColor : cellStyle.BackColor)) graphics.FillRectangle(b, cellBounds); } else if (DataGridView.Enabled) { base.Paint(graphics, clipBounds, cellBounds, rowIndex, elementState, value, formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts); } else { Image img = (Image)value; using (Brush b = new SolidBrush(Selected ? cellStyle.SelectionBackColor : cellStyle.BackColor)) graphics.FillRectangle(b, cellBounds); if (img == null) return; ControlPaint.DrawImageDisabled(graphics, img, cellBounds.X + ((cellBounds.Width - img.Width) / 2), cellBounds.Y + ((cellBounds.Height - img.Height) / 2), Selected ? cellStyle.SelectionBackColor : cellStyle.BackColor); } }
0
14. Example
View licenseprotected override void OnRenderItemImage(ToolStripItemImageRenderEventArgs e) { // We only override the image drawing for context menus /* if ((e.ToolStrip is ContextMenuStrip) || (e.ToolStrip is ToolStripDropDownMenu)) {*/ if (e.Image != null) { var checkbox = e.Item as ToolStripMenuItem; if (checkbox == null || checkbox.CheckState == CheckState.Unchecked) { var newrect = AdjustDrawRectangle(e.Item, e.ImageRectangle); if (e.Item.Enabled) { newrect.X += 3; e.Graphics.DrawImageUnscaledAndClipped(e.Image, newrect); } else ControlPaint.DrawImageDisabled(e.Graphics, e.Image, newrect.X, newrect.Y, Color.Transparent); } } /* } else { // base.OnRenderItemImage(e); }*/ }
0
15. Example
View licenseprotected virtual void DrawAlignedImage(Graphics g, Rectangle r, Image image) { if (image == null) return; // By default, the image goes in the top left of the rectangle Rectangle imageBounds = new Rectangle(r.Location, image.Size); // If the image is too tall to be drawn in the space provided, proportionally scale it down. // Too wide images are not scaled. if (image.Height > r.Height) { float scaleRatio = (float) r.Height / (float) image.Height; imageBounds.Width = (int) ((float) image.Width * scaleRatio); imageBounds.Height = r.Height - 1; } // Align and draw our (possibly scaled) image Rectangle alignRectangle = this.AlignRectangle(r, imageBounds); if (this.ListItem.Enabled) g.DrawImage(image, alignRectangle); else ControlPaint.DrawImageDisabled(g, image, alignRectangle.X, alignRectangle.Y, GetBackgroundColor()); }
0
16. Example
View licenseprotected virtual void DrawAlignedImage(Graphics g, Rectangle r, Image image) { if (image == null) return; // By default, the image goes in the top left of the rectangle Rectangle imageBounds = new Rectangle(r.Location, image.Size); // If the image is too tall to be drawn in the space provided, proportionally scale it down. // Too wide images are not scaled. if (image.Height > r.Height) { float scaleRatio = (float)r.Height / (float)image.Height; imageBounds.Width = (int)((float)image.Width * scaleRatio); imageBounds.Height = r.Height - 1; } // Align and draw our (possibly scaled) image Rectangle alignRectangle = this.AlignRectangle(r, imageBounds); if (this.ListItem.Enabled) g.DrawImage(image, alignRectangle); else ControlPaint.DrawImageDisabled(g, image, alignRectangle.X, alignRectangle.Y, GetBackgroundColor()); }
0
17. Example
View licenseprotected virtual void DrawAlignedImage(Graphics g, Rectangle r, Image image) { if (image == null) return; // By default, the image goes in the top left of the rectangle Rectangle imageBounds = new Rectangle(r.Location, image.Size); // If the image is too tall to be drawn in the space provided, proportionally scale it down. // Too wide images are not scaled. if (image.Height > r.Height) { float scaleRatio = (float) r.Height / (float) image.Height; imageBounds.Width = (int) ((float) image.Width * scaleRatio); imageBounds.Height = r.Height - 1; } // Align and draw our (possibly scaled) image Rectangle alignRectangle = this.AlignRectangle(r, imageBounds); if (this.ListItem.Enabled) g.DrawImage(image, alignRectangle); else ControlPaint.DrawImageDisabled(g, image, alignRectangle.X, alignRectangle.Y, GetBackgroundColor()); }
0
18. Example
View licenseprotected virtual void DrawAlignedImage(Graphics g, Rectangle r, Image image) { if (image == null) return; // By default, the image goes in the top left of the rectangle Rectangle imageBounds = new Rectangle(r.Location, image.Size); // If the image is too tall to be drawn in the space provided, proportionally scale it down. // Too wide images are not scaled. if (image.Height > r.Height) { float scaleRatio = (float)r.Height / (float)image.Height; imageBounds.Width = (int)((float)image.Width * scaleRatio); imageBounds.Height = r.Height - 1; } // Align and draw our (possibly scaled) image Rectangle alignRectangle = this.AlignRectangle(r, imageBounds); if (this.ListItem.Enabled) g.DrawImage(image, alignRectangle); else ControlPaint.DrawImageDisabled(g, image, alignRectangle.X, alignRectangle.Y, GetBackgroundColor()); }
0
19. Example
View licenseprivate void DrawImage(Graphics g) { Image image = this.Enabled ? ImageEnabled :/n ..... /n //View Source file for more details /n }
0
20. Example
View licenseprivate void DrawImage(Graphics g) { Image image = this.Enabled ? ImageEnabled : ((ImageDisable/n ..... /n //View Source file for more details /n }
0
21. Example
View licenseprotected virtual int DrawImage(Graphics g, Rectangle r, Object imageSelector) { if (ima/n ..... /n //View Source file for more details /n }
0
22. Example
View licenseprotected virtual int DrawImage(Graphics g, Rectangle r, Object imageSelector) { if (ima/n ..... /n //View Source file for more details /n }
0
23. Example
View licenseprotected void DrawImageAndText(Graphics g, Rectangle r) { int offset = 0; if (m_columnIndex == 0) { int imgIndex = SmallImageList.Images.IndexOfKey(m_listItem.ImageKey); Rectangle r2 = new Rectangle(r.X, r.Y, r.Width, r.Height); int flags = ILD_TRANSPARENT; if (m_listItem.Selected) flags |= ILD_BLEND25; if (m_listItem.Checked) { bool result = ImageList_Draw(SmallImageList.Handle, imgIndex, g.GetHdc(), r2.X, r2.Y, flags); g.ReleaseHdc(); } else ControlPaint.DrawImageDisabled(g, SmallImageList.Images[imgIndex], r2.X, r2.Y, Color.Transparent); offset = SmallImageList.ImageSize.Width; } r.X += offset; r.Width -= offset; offset = this.DrawText(g, r, m_listItem.SubItems[m_columnIndex].Text); }
0
24. Example
View licenseprivate int DrawImage(Graphics g, Rectangle r, Object imageSelector) { if (image/n ..... /n //View Source file for more details /n }
0
25. Example
View licenseprotected override void OnRenderItemImage(ToolStripItemImageRenderEventArgs e) { Rectangle destRect = e.ImageRectangle; destRect.X += m_sideBorder + m_sideBorder / 2; Image normalImage = e.Image; if ((destRect != Rectangle.Empty) && (normalImage != null)) { if (e.Item.Enabled) { e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; e.Graphics.DrawImage(normalImage, destRect); } else { Image disabledImage = new Bitmap(destRect.Width, destRect.Height); Graphics g = Graphics.FromImage(disabledImage); g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.DrawImage(e.Image, 0, 0, destRect.Width, destRect.Height); g.Dispose(); ControlPaint.DrawImageDisabled(e.Graphics, disabledImage, destRect.X, destRect.Y, Color.Transparent); } } }
0
26. Example
View licenseprotected override void OnRenderItemImage(ToolStripItemImageRenderEventArgs e) { Rectangle destRect = e.ImageRectangle; destRect.X++; destRect.Width -= 2; destRect.Y++; destRect.Height -= 2; Image normalImage = e.Image; if ((destRect != Rectangle.Empty) && (normalImage != null)) { if (e.Item.Enabled) { e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; e.Graphics.DrawImage(normalImage, destRect); } else { Image disabledImage = new Bitmap(destRect.Width, destRect.Height); Graphics g = Graphics.FromImage(disabledImage); g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.DrawImage(e.Image, 0, 0, destRect.Width, destRect.Height); g.Dispose(); ControlPaint.DrawImageDisabled(e.Graphics, disabledImage, destRect.X, destRect.Y, Color.Transparent); } } }
0
27. Example
View licensepublic void DrawIcon(Graphics g, Image icon, Rectangle bounds, bool selected, bool enabled, bool isChecked) { // make icon transparent Color transparentColor = Color.FromArgb(0, 128, 128); Bitmap tempIcon = (Bitmap)icon; tempIcon.MakeTransparent(transparentColor); int iconTop = bounds.Top + (itemHeight - BITMAP_SIZE)/2; int iconLeft = bounds.Left + ( STRIPE_WIDTH - BITMAP_SIZE)/2; if (enabled) { if (selected) { if ( isChecked ) { DrawCheckedRectangle(g, bounds); g.DrawImage(icon, iconLeft + 1, iconTop); } else { ControlPaint.DrawImageDisabled(g, icon, iconLeft + 1, iconTop, Color.Black); g.DrawImage(icon, iconLeft, iconTop-1); } } else { if ( isChecked ) DrawCheckedRectangle(g, bounds); g.DrawImage(icon, iconLeft + 1, iconTop); } } else { ControlPaint.DrawImageDisabled(g, icon, iconLeft + 1, iconTop, SystemColors.HighlightText); } }
0
28. Example
View licensepublic void DrawIcon(Graphics g, Image icon, Rectangle bounds, bool selected, bool enabled, bool isChecked) { // make icon transparent Color transparentColor = Color.FromArgb(0, 128, 128); Bitmap tempIcon = (Bitmap)icon; tempIcon.MakeTransparent(transparentColor); int iconTop = bounds.Top + (itemHeight - BITMAP_SIZE)/2; int iconLeft = bounds.Left + ( STRIPE_WIDTH - BITMAP_SIZE)/2; if (enabled) { if (selected) { if ( isChecked ) { DrawCheckedRectangle(g, bounds); g.DrawImage(icon, iconLeft + 1, iconTop); } else { ControlPaint.DrawImageDisabled(g, icon, iconLeft + 1, iconTop, Color.Black); g.DrawImage(icon, iconLeft, iconTop-1); } } else { if ( isChecked ) DrawCheckedRectangle(g, bounds); g.DrawImage(icon, iconLeft + 1, iconTop); } } else { ControlPaint.DrawImageDisabled(g, icon, iconLeft + 1, iconTop, SystemColors.HighlightText); } }
0
29. Example
View licenseprivate void DrawImage(Graphics g) { Image image = Enabled ? ImageEnabled : ((Im/n ..... /n //View Source file for more details /n }
0
30. Example
View licenseprivate void DrawImage(Graphics g) { Image image = this.Enabled ? ImageEnabled :/n ..... /n //View Source file for more details /n }
0
31. Example
View licenseprotected virtual int DrawImage(Graphics g, Rectangle r, Object imageSelector) { if (ima/n ..... /n //View Source file for more details /n }
0
32. Example
View licenseprivate void PaintTextandImage(Graphics g, Rectangle bounds) { // Figure out where our text and image should go Rectangle text_rectangle; Rectangle image_rectangle; CalculateButtonTextAndImageLayout(ref bounds, out text_rectangle, out image_rectangle); //draw the image if (Image != null) { if (Enabled) g.DrawImage(Image, image_rectangle.X, image_rectangle.Y, Image.Width, Image.Height); else ControlPaint.DrawImageDisabled(g, Image, image_rectangle.X, image_rectangle.Y, BackColor); } // If we dont' use mnemonic, set formatFlag to NoPrefix as this will show ampersand. if (!UseMnemonic) textFormatFlags = textFormatFlags | TextFormatFlags.NoPrefix; else if (!ShowKeyboardCues) textFormatFlags = textFormatFlags | TextFormatFlags.HidePrefix; //draw the text if (!string.IsNullOrEmpty(Text)) { TextRenderer.DrawText(g, Text, Font, text_rectangle, Enabled ? ForeColor : SystemColors.ControlDark, textFormatFlags); } }
0
33. Example
View licenseprivate void DrawImage(Graphics g) { Image image = this.Enabled ? ImageEnabled : ((ImageDisable/n ..... /n //View Source file for more details /n }
0
34. Example
View licenseprivate void DrawImage(Graphics g) { Image image = this.Enabled ? ImageEnabled : ((ImageDisable/n ..... /n //View Source file for more details /n }
0
35. Example
View licenseprivate void PaintTextandImage(Graphics g, Rectangle bounds) { // Figure out where our text and image should go Rectangle text_rectangle; Rectangle image_rectangle; CalculateButtonTextAndImageLayout(ref bounds, out text_rectangle, out image_rectangle); //draw the image if (Image != null) { if (Enabled) g.DrawImage(Image, image_rectangle.X, image_rectangle.Y, Image.Width, Image.Height); else ControlPaint.DrawImageDisabled(g, Image, image_rectangle.X, image_rectangle.Y, BackColor); } // If we dont' use mnemonic, set formatFlag to NoPrefix as this will show ampersand. if (!UseMnemonic) textFormatFlags = textFormatFlags | TextFormatFlags.NoPrefix; else if (!ShowKeyboardCues) textFormatFlags = textFormatFlags | TextFormatFlags.HidePrefix; //draw the text if (!string.IsNullOrEmpty(Text)) { if (Enabled) TextRenderer.DrawText(g, Text, Font, text_rectangle, ForeColor, textFormatFlags); else ControlPaint.DrawStringDisabled(g, Text, Font, BackColor, text_rectangle, textFormatFlags); } }
0
36. Example
View licenseprotected virtual int DrawImage(Graphics g, Rectangle r, Object imageSelector) { if (ima/n ..... /n //View Source file for more details /n }
0
37. Example
View licenseprivate void PaintTextandImage(Graphics g, Rectangle bounds) { // Figure out where our text and image should go Rectangle text_rectangle; Rectangle image_rectangle; CalculateButtonTextAndImageLayout(ref bounds, out text_rectangle, out image_rectangle); //draw the image if (Image != null) { if (Enabled) g.DrawImage(Image, image_rectangle.X, image_rectangle.Y, Image.Width, Image.Height); else ControlPaint.DrawImageDisabled(g, Image, image_rectangle.X, image_rectangle.Y, BackColor); } // If we dont' use mnemonic, set formatFlag to NoPrefix as this will show ampersand. if (!UseMnemonic) textFormatFlags = textFormatFlags | TextFormatFlags.NoPrefix; else if (!ShowKeyboardCues) textFormatFlags = textFormatFlags | TextFormatFlags.HidePrefix; //draw the text if (!string.IsNullOrEmpty(Text)) { if (Enabled) TextRenderer.DrawText(g, Text, Font, text_rectangle, ForeColor, textFormatFlags); else ControlPaint.DrawStringDisabled(g, Text, Font, BackColor, text_rectangle, textFormatFlags); } }
0
38. Example
View licenseprivate void PaintTextandImage(Graphics g, Rectangle bounds) { // Figure out where our text and image should go Rectangle text_rectangle; Rectangle image_rectangle; CalculateButtonTextAndImageLayout(ref bounds, out text_rectangle, out image_rectangle); //draw the image if (Image != null) { if (Enabled) g.DrawImage(Image, image_rectangle.X, image_rectangle.Y, Image.Width, Image.Height); else ControlPaint.DrawImageDisabled(g, Image, image_rectangle.X, image_rectangle.Y, BackColor); } // If we dont' use mnemonic, set formatFlag to NoPrefix as this will show ampersand. if (!UseMnemonic) _textFormatFlags = _textFormatFlags | TextFormatFlags.NoPrefix; else if (!ShowKeyboardCues) _textFormatFlags = _textFormatFlags | TextFormatFlags.HidePrefix; //draw the text if (!string.IsNullOrEmpty(Text)) { if (Enabled) TextRenderer.DrawText(g, Text, Font, text_rectangle, ForeColor, _textFormatFlags); else ControlPaint.DrawStringDisabled(g, Text, Font, BackColor, text_rectangle, _textFormatFlags); } }
0
39. Example
View licenseprotected override void OnPaint(PaintEventArgs e) { if (Owner == null) /n ..... /n //View Source file for more details /n }
0
40. Example
View licenseprotected virtual int DrawImages(Graphics g, Rectangle r, ICollection imageSelectors) { // Collect the non-null images List<Image> images = new List<Image>(); foreach (Object selector in imageSelectors) { Image image = this.GetImage(selector); if (image != null) images.Add(image); } // Figure out how much space they will occupy int width = 0; int height = 0; foreach (Image image in images) { width += (image.Width + this.Spacing); height = Math.Max(height, image.Height); } // Align the collection of images within the cell Rectangle r2 = this.AlignRectangle(r, new Rectangle(0, 0, width, height)); // Finally, draw all the images in their correct location Color backgroundColor = GetBackgroundColor(); Point pt = r2.Location; foreach (Image image in images) { if (this.ListItem.Enabled) g.DrawImage(image, pt); else ControlPaint.DrawImageDisabled(g, image, pt.X, pt.Y, backgroundColor); pt.X += (image.Width + this.Spacing); } // Return the width that the images occupy return width; }
0
41. Example
View licenseprotected override void OnPaint(PaintEventArgs e) { Rectangle basearea = new Rectangle(Padding/n ..... /n //View Source file for more details /n }
0
42. Example
View licenseprotected virtual int DrawImages(Graphics g, Rectangle r, ICollection imageSelectors) { // Collect the non-null images List<Image> images = new List<Image>(); foreach (Object selector in imageSelectors) { Image image = this.GetImage(selector); if (image != null) images.Add(image); } // Figure out how much space they will occupy int width = 0; int height = 0; foreach (Image image in images) { width += (image.Width + this.Spacing); height = Math.Max(height, image.Height); } // Align the collection of images within the cell Rectangle r2 = this.AlignRectangle(r, new Rectangle(0, 0, width, height)); // Finally, draw all the images in their correct location Color backgroundColor = GetBackgroundColor(); Point pt = r2.Location; foreach (Image image in images) { if (this.ListItem.Enabled) g.DrawImage(image, pt); else ControlPaint.DrawImageDisabled(g, image, pt.X, pt.Y, backgroundColor); pt.X += (image.Width + this.Spacing); } // Return the width that the images occupy return width; }
0
43. Example
View licenseprotected virtual int DrawImages(Graphics g, Rectangle r, ICollection imageSelectors) { // Collect the non-null images List<Image> images = new List<Image>(); foreach (Object selector in imageSelectors) { Image image = this.GetImage(selector); if (image != null) images.Add(image); } // Figure out how much space they will occupy int width = 0; int height = 0; foreach (Image image in images) { width += (image.Width + this.Spacing); height = Math.Max(height, image.Height); } // Align the collection of images within the cell Rectangle r2 = this.AlignRectangle(r, new Rectangle(0, 0, width, height)); // Finally, draw all the images in their correct location Color backgroundColor = GetBackgroundColor(); Point pt = r2.Location; foreach (Image image in images) { if (this.ListItem.Enabled) g.DrawImage(image, pt); else ControlPaint.DrawImageDisabled(g, image, pt.X, pt.Y, backgroundColor); pt.X += (image.Width + this.Spacing); } // Return the width that the images occupy return width; }
0
44. Example
View licensepublic override void Render(Graphics g, Rectangle r) { this.DrawBackground(g, r); /n ..... /n //View Source file for more details /n }
0
45. Example
View licenseprotected virtual int DrawImages(Graphics g, Rectangle r, ICollection imageSelectors) { // Collect the non-null images List<Image> images = new List<Image>(); foreach (Object selector in imageSelectors) { Image image = this.GetImage(selector); if (image != null) images.Add(image); } // Figure out how much space they will occupy int width = 0; int height = 0; foreach (Image image in images) { width += (image.Width + this.Spacing); height = Math.Max(height, image.Height); } // Align the collection of images within the cell Rectangle r2 = this.AlignRectangle(r, new Rectangle(0, 0, width, height)); // Finally, draw all the images in their correct location Color backgroundColor = GetBackgroundColor(); Point pt = r2.Location; foreach (Image image in images) { if (this.ListItem.Enabled) g.DrawImage(image, pt); else ControlPaint.DrawImageDisabled(g, image, pt.X, pt.Y, backgroundColor); pt.X += (image.Width + this.Spacing); } // Return the width that the images occupy return width; }
0
46. Example
View licensepublic override void Render(Graphics g, Rectangle r) { this.DrawBackground(g, r); /n ..... /n //View Source file for more details /n }
0
47. Example
View licensepublic override void Render(Graphics g, Rectangle r) { this.DrawBackground(g, r); /n ..... /n //View Source file for more details /n }
0
48. Example
View licensepublic override void Render(Graphics g, Rectangle r) { this.DrawBackground(g, r); /n ..... /n //View Source file for more details /n }
0
49. Example
View licenseprotected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { SolidBrush _brush01/n ..... /n //View Source file for more details /n }
0
50. Example
View licenseprotected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { SolidBrush _brush01/n ..... /n //View Source file for more details /n }