示例#1
0
        /// <summary>
        /// 重绘事件
        /// </summary>
        private void NewPictureBox_Paint(object sender, PaintEventArgs e)
        {
            CustomDrawEventHandler eventHandle = Events[_customDraw] as CustomDrawEventHandler;

            if (eventHandle != null)
            {
                eventHandle(e.Graphics, 0, 0, sender, null);
            }
        }
示例#2
0
        protected internal virtual void RaiseCustomDraw(MyCustomDrawArgs args)
        {
            CustomDrawEventHandler handler = (CustomDrawEventHandler)this.Events[customDraw];

            if (handler != null)
            {
                handler(this, args);
            }
        }
示例#3
0
        internal void RaiseCustomDrawItem(CustomDrawEventArgs e)
        {
            CustomDrawEventHandler handler = (CustomDrawEventHandler)Events[customDraw];

            if (handler != null)
            {
                handler(GetEventSender(), e);
            }
        }
示例#4
0
 public void Draw(Graphics g, float x, float y)
 {
     if (Image != null)
     {
         g.DrawImage(Image, x, y, Width, Height);
     }
     else
     {
         CustomDrawEventHandler eventHandle = Events[_customDraw] as CustomDrawEventHandler;
         if (eventHandle != null)
         {
             eventHandle(g, x, y, this, null);
         }
     }
 }
示例#5
0
 /// <summary>
 /// IPrintable 接口方法的实现绘制
 /// </summary>
 public void Draw(Graphics g, float x, float y)
 {
     if (pictureBox1.Image != null)
     {
         using (Bitmap pic = new Bitmap(pictureBox1.Image))
         {
             g.DrawImage(pic, x, y, panelMain.Width, panelMain.Height);
         }
     }
     else
     {
         CustomDrawEventHandler eventHandle = Events[_customDraw] as CustomDrawEventHandler;
         if (eventHandle != null)
         {
             eventHandle(g, x, y, this, null);
         }
     }
 }