Esempio n. 1
0
 ///<summary>It is planned to move some of this logic to OnPaint and use a true double buffer.</summary>
 public void CreateShadow()
 {
     if (this.Parent is ContrApptSheet)
     {
         bool isVisible = ApptDrawing.GetIndexOp(OpNum) >= 0;
         if (!isVisible)
         {
             return;
         }
     }
     DisposeShadow();
     if (Width < 4)
     {
         return;
     }
     if (Height < 4)
     {
         return;
     }
     Shadow = new Bitmap(Width, Height);
     using (Graphics g = Graphics.FromImage(Shadow)) {
         ApptSingleDrawing.DrawEntireAppt(g, DataRoww, PatternShowing, Width, Height, IsSelected, ThisIsPinBoard, SelectedAptNum,
                                          ApptViewItemL.ApptRows, ApptViewItemL.ApptViewCur, TableApptFields, TablePatFields, 8, false);
         //In most cases, drawing will be taken care of by ContrApptSheet.DoubleBufferDraw().
         //However, BackgroundImage must be set here to draw the bitmap when when dragging.
         this.BackgroundImage = Shadow;
     }
 }
Esempio n. 2
0
        ///<summary>It is planned to move some of this logic to OnPaint and use a true double buffer.</summary>
        public void CreateShadow()
        {
            if (this.Parent is ContrApptSheet)
            {
                bool isVisible = ApptDrawing.GetIndexOp(OpNum) >= 0;
                if (!isVisible)
                {
                    return;
                }
            }
            DisposeShadow();
            if (Width < 4)
            {
                return;
            }
            if (Height < 4)
            {
                return;
            }
            Bitmap shadowNew = new Bitmap(Width, Height);

            using (Graphics g = Graphics.FromImage(shadowNew)) {
                ApptSingleDrawing.DrawEntireAppt(g, DataRoww, PatternShowing, Width, Height, IsSelected, ThisIsPinBoard, SelectedAptNum,
                                                 ApptViewItemL.ApptRows, ApptViewItemL.ApptViewCur, TableApptFields, TablePatFields, 8, false);
            }
            //In most cases, drawing will be taken care of by ContrApptSheet.DoubleBufferDraw().
            //However, BackgroundImage must be set here to draw the bitmap when when dragging.
            //If this was inside the using block, a GDI+ exception would sometimes be thrown because the graphics object would still be accessing the
            //image data when the image reference was changed.
            Shadow          = shadowNew;
            BackgroundImage = shadowNew;
        }
Esempio n. 3
0
 ///<summary>It is planned to move some of this logic to OnPaint and use a true double buffer.</summary>
 public void CreateShadow()
 {
     if (this.Parent is ContrApptSheet)
     {
         bool isVisible = false;
         for (int j = 0; j < ApptDrawing.VisOps.Count; j++)
         {
             if (DataRoww["Op"].ToString() == ApptDrawing.VisOps[j].OperatoryNum.ToString())
             {
                 isVisible = true;
             }
         }
         if (!isVisible)
         {
             return;
         }
     }
     if (Shadow != null)
     {
         Shadow.Dispose();
         Shadow = null;
     }
     if (Width < 4)
     {
         return;
     }
     if (Height < 4)
     {
         return;
     }
     Shadow = new Bitmap(Width, Height);
     if (PatternShowing == null)
     {
         PatternShowing = "";
     }
     using (Graphics g = Graphics.FromImage(Shadow)) {
         ApptSingleDrawing.DrawEntireAppt(g, DataRoww, PatternShowing, Width, Height, IsSelected, ThisIsPinBoard, SelectedAptNum,
                                          ApptViewItemL.ApptRows, ApptViewItemL.ApptViewCur, TableApptFields, TablePatFields, 8, false);
         this.BackgroundImage = Shadow;
     }
 }