Changeset 856 for branches/eraser6/Eraser/AboutForm.cs
- Timestamp:
- 1/5/2009 10:47:44 AM (3 years ago)
- File:
-
- 1 edited
-
branches/eraser6/Eraser/AboutForm.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Eraser/AboutForm.cs
r853 r856 192 192 } 193 193 194 private void AboutForm_Paint(object sender, PaintEventArgs e) 195 { 196 DrawComposite(e.Graphics); 197 } 198 194 199 private void AboutForm_MouseMove(object sender, MouseEventArgs e) 195 200 { … … 217 222 AboutTextScrollTop -= 1; 218 223 219 DrawComposite(); 220 } 221 222 private void DrawComposite() 224 using (Graphics g = CreateGraphics()) 225 DrawComposite(g); 226 } 227 228 private void DrawComposite(Graphics g) 223 229 { 224 230 if (DoubleBufferBitmap == null) 225 231 DoubleBufferBitmap = new Bitmap(ClientSize.Width, ClientSize.Height); 226 using (Graphics g = Graphics.FromImage(DoubleBufferBitmap))232 using (Graphics bg = Graphics.FromImage(DoubleBufferBitmap)) 227 233 { 228 234 //Draw the parent image with a fading out effect 235 if (ParentOpacity > 128) 236 bg.Clip = new Region(AboutTextRect); 237 229 238 Brush brush = new SolidBrush(Color.FromArgb(ParentOpacity, 0, 0, 0)); 230 g.DrawImageUnscaled(ParentBitmap, 0, 0);231 g.FillRectangle(brush, ClientRectangle);239 bg.DrawImageUnscaled(ParentBitmap, 0, 0); 240 bg.FillRectangle(brush, ClientRectangle); 232 241 233 242 //Then draw the About bitmap (which we cached in the constructor) 234 g.DrawImageUnscaled(AboutBitmap, AboutBitmapPos);243 bg.DrawImageUnscaled(AboutBitmap, AboutBitmapPos); 235 244 236 245 //And the scrolling text 237 g.Clip = new Region(AboutTextRect);238 g.DrawImageUnscaled(AboutTextBitmap, AboutTextRect.Left,246 bg.Clip = new Region(AboutTextRect); 247 bg.DrawImageUnscaled(AboutTextBitmap, AboutTextRect.Left, 239 248 AboutTextRect.Top + AboutTextScrollTop); 240 g.ResetClip(); 241 } 242 243 using (Graphics g = CreateGraphics()) 244 g.DrawImageUnscaled(DoubleBufferBitmap, 0, 0); 249 bg.ResetClip(); 250 } 251 252 if (ParentOpacity > 128) 253 if (g.Clip != null) 254 g.Clip.Complement(new Region(AboutTextRect)); 255 else 256 g.Clip = new Region(AboutTextRect); 257 g.DrawImageUnscaled(DoubleBufferBitmap, 0, 0); 245 258 } 246 259 }
Note: See TracChangeset
for help on using the changeset viewer.
