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. Clpping Region is Not Operate with Printpreview

Clpping Region is Not Operate with Printpreview

Scheduled Pinned Locked Moved C / C++ / MFC
graphicstutorial
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.
  • A Offline
    A Offline
    Andrebon
    wrote on last edited by
    #1

    Drawing Bitmap on view(DC) with Clipping Region Operate well. But, Drawing On PrintPreview(DC) Don't operate. Please See My Code. CBitmap Bitmap, *pOldBitmap; Bitmap.LoadBitmap(IDB_BITMAP1); CDC MemDC; MemDC.CreateCompatibleDC( pDC ); pOldBitmap = MemDC.SelectObject( &Bitmap ); pDC->SetMapMode( MM_TEXT); CPoint pt[3]; pt[0] = CPoint( 0, 0 ); pt[1] = CPoint( 0, 480); pt[2] = CPoint( 640, 480); CRgn ClipRgn; CRgn rgnRect; rgnRect.CreateRectRgn( 0, 0, 640, 480 ); pDC->BeginPath(); pDC->Polygon( pt, 3); pDC->EndPath(); pDC->StrokePath(); ClipRgn.CreatePolygonRgn(pt, 3, ALTERNATE); ClipRgn.CombineRgn( &ClipRgn, &rgnRect, RGN_AND ); if( pDC->IsPrinting() ) { pDC->SelectClipRgn( &ClipRgn ); pDC->StretchBlt( 0, 0, 1000, 1000, &MemDC,0,0,640,480, SRCCOPY ); } else{ pDC->StretchBlt( 0, 0, 1000, 1000, &MemDC, 0, 0, 640,480, SRCCOPY ); } MemDC.SelectObject(pOldBitmap); MemDC.DeleteDC(); Bitmap.DeleteObject(); I want know How to use SelectClipRgn() function with printpreview state thanks

    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