我想在PictureBox中繪製一些小圖片(連續4 x 32px圖像),所以我應該重寫OnPaint方法或我需要使我的新組件擴展PictureBox? 我嘗試這樣做,它在Java中的工作,而不是在這裏: this.pictureBox1 = new System.Windows.Forms.PictureBox()
{
protected override void O
我創建它畫在我的基地png圖片,從基礎,我可以保存爲PNG圖像,供大家參考 Graphics g = e.Graphics;
....
g.DrawLine(pen, new Point(x, y), new Point(x1, y1));
.....
base.OnPaint(e);
using (var bmp = new Bitmap(500, 50))
{
base
我重寫了我的控件中的OnPaint方法,該方法是直接從我自己的ICan3D.Graphics類生成的圖像中繪製的。當我保存圖像時(正如你所看到的那樣,該行被註釋掉了)圖像是正確的。但是,當表單加載時,它不會將圖像顯示爲背景。 Imports System
Namespace ICan3D
Public Class RenderSurface
Inherits Contr
由於篇幅較短且易於理解,我將首先發布我的代碼,然後我會問我的問題。 public class BatteryLabel : Control
{
private Color _captionColor = SystemColors.Control;
private Color _textColor = SystemColors.Info;
private Color