Komentare jsou sice v AJ, ale naprosto srozumitelne:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
//Tyto atributy zde nemusi byt, funguje to stejne dobre i bez nich [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.LinkDemand, Flags = System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); // Get handle to device context. IntPtr hdc = e.Graphics.GetHdc(); // Create new graphics object using handle to device context. Graphics newGraphics = Graphics.FromHdc(hdc); // Draw rectangle to screen. newGraphics.DrawRectangle(new Pen(Color.Red, 3), 0, 0, 200, 100); // Release handle to device context and dispose of the Graphics object e.Graphics.ReleaseHdc(hdc); newGraphics.Dispose(); } |
Snad si nekdy udelam cas a tento clanek rozsirim aby vas naucil jak delat vyrezy obrazovky s pohledem na to co vyrezavate.