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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to improve bitmap drawing quality?

How to improve bitmap drawing quality?

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshelpcssperformancetutorial
1 Posts 1 Posters 0 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.
  • U Offline
    U Offline
    User 477100
    wrote on last edited by
    #1

    I need to graphically represent dynamically changing physical grid (300x300) on maximal logical display coordinates, which is usually much larger (~600x600 and more). To avoid blinking, I, first, create Bitmap (according to the grid size) in the memory and thus, using BitBlt, extend it graphically to maximal display size. My problem is that such extension makes Bitmap quality unacceptable. However, using physical grid with the same size (or more) as the display projected, doesn’t reduce the quality. Enclosed below please find the code. void CRecDrawView::OnDraw(CDC* pDC) { CRect rect ; int X, X1, Y, Y1, MatrixPart, DrawPart; COLORREF color = RGB( 128, 128, 0 ); GetClientRect(rect ); int oldBkMode = pDC->SetBkMode(TRANSPARENT); DrawPart = (rect.Width( ) < rect.Height( ) ) ? rect.Width( ) : rect.Height( ) ; if(DrawPart > MaxCoordinate) DrawPart = MaxCoordinate; MatrixPart = MaxCoordinate/DrawPart ; // part of matrix, which must be displayed X = 0 ; X1 = X + DrawPart; Y = 0 ; Y1 = Y + DrawPart; CDC memdc, * myDC; pDC->SetMapMode(MM_ISOTROPIC); SetWindowExtEx(*pDC,DrawPart,DrawPart,NULL); SetViewportExtEx(*pDC,rect.right, -rect.bottom,NULL); SetViewportOrgEx(*pDC,0,rect.bottom,NULL); CBitmap bmp, *poldbmp; memdc.CreateCompatibleDC( pDC); bmp.CreateCompatibleBitmap (pDC, DrawPart, DrawPart); poldbmp = memdc.SelectObject( &bmp ); memdc.BitBlt( 0,0,DrawPart, DrawPart,&memdc, 0, 0, WHITENESS ); myDC = &memdc; ... } I’ll be much appreciated for any kind of help. German

    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