Graphics gp = Graphics.FromHwnd(p2pPic.Handle);
SolidBrush sb = new SolidBrush(Color.DodgerBlue);
lock (gpPalette)
{
gpP.FillRectangle(sb, aRectangle);
}
p2pPic is a PictureBox object in c#;
these are the main code ,and code does run, but did not take any effect who can tell me why?
Depends where you have placed this code. PictureBox would eventually do its own painting.