private void Writer_Paint(object sender, PaintEventArgs e) { e.Graphics.Clear(Color.Black); if (view == View.Note) { for (int i = 1; i < ContentRects.Count; i++) { // e.Graphics.SetClip(new Rectangle(0, 0, this.Width, this.Height)); if (ContentRects[i].Y + ShiftIndex.Y < this.Height && ShiftIndex.Y + ContentRects[i].Y + ContentRects[i].Height > 0) { e.Graphics.DrawString(TitleContents[i], this.Font, Brushes.White, GetShiftedRect(ContentRects[i])); } } for (int i = 0; i < EntityRects.Count; i++) { if (EntityRects[i].Y + ShiftIndex.Y < this.Height && ShiftIndex.Y + EntityRects[i].Y + EntityRects[i].Height > 0) { if (i == SelectedThumbIndex) { e.Graphics.DrawImage(SD.Images.ChangeImage.ApplyColorMatrix(Entities[i].GetThumbnail(), SD.Images.ChangeImage.ImageProperty.Negative), GetShiftedRect(EntityRects[i])); } else { e.Graphics.DrawImage(Entities[i].GetThumbnail(), GetShiftedRect(EntityRects[i])); } } } if (TitleContents.Count > 0) { e.Graphics.FillRectangle(Brushes.Gold, new RectangleF(0, 0, this.Width, 30)); e.Graphics.DrawString(TitleContents[0], fontTitle, Brushes.Black, ContentRects[0]); } } else if (view == View.FullImage) { FullImage.Paint(e.Graphics); } }
//Create a paint event private void Form1_Paint(object sender, PaintEventArgs e) { FullImage.Paint(e.Graphics); }