Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Painting RichEditView

Painting RichEditView

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsperformancehelp
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nightrider13
    wrote on last edited by
    #1

    Hi, I have made a Project derived from CRichEditView and I want to paint the Client-Area. The painting works perfectly there, is no flickering at all but there is a problem with the caret and the displayed signs. The caret appears completely strange and the displayed signs are not visible. Here is all I added to my project: BOOL CRichEdit2View::OnEraseBkgnd(CDC* pDC) { // TODO: Fügen Sie hier Ihren Meldungsbehandlungscode ein, und/oder benutzen Sie den Standard. COLORREF crFgcol = 0, crBgcol = RGB(209,255,176); CRect rect; GetClientRect(&rect); // We double buffer the drawing - // preparing the memory CDC CDC dc; dc.CreateCompatibleDC(pDC); // Create GDI and select objects CBitmap bmp; CPen pen; bmp.CreateCompatibleBitmap( pDC, rect.Width(), rect.Height() ); pen.CreatePen( PS_SOLID, 1, crFgcol ); CBitmap *pOldBitmap = dc.SelectObject( &bmp ); CPen *pOldPen = dc.SelectObject( &pen ); // Painting the background dc.FillSolidRect( &rect, RGB(255,255,255) ); // komplett CRect rcBar(rect); rcBar.top = 100; rcBar.bottom = 120; dc.FillSolidRect( &rcBar, crBgcol ); // Rand dc.MoveTo( rect.right - 1, 0 ); // dc.LineTo( rect.right - 1, rect.bottom ); pDC->BitBlt( 0, 0, rect. right, rect.bottom, &dc, 0, 0, SRCCOPY ); // Aufräumen dc.SelectObject( pOldBitmap ); dc.SelectObject( pOldPen ); return TRUE; } HBRUSH CRichEdit2View::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { pDC->SetBkMode(TRANSPARENT); return NULL; } void CRichEdit2View::OnPaint() { CPaintDC dc(this); // device context for painting // TODO: Fügen Sie hier Ihren Meldungsbehandlungscode ein. // CRichEditView::OnPaint() soll zum Zeichnen von Meldungen nicht aufgerufen werden. } I would be really happy if someone has an answer for me :)

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups