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. Converting Buffer image to DC

Converting Buffer image to DC

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsperformancetutorialquestion
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
    uus99
    wrote on last edited by
    #1

    Hi, I have a framegrabber that snaps an image and sends it to a memory buffer at m_pBuffer (type of LPVOID). I do not know the content structure of the m_pBuffer, but i know i contains a 24bit RGB Bitmap. Doing the operation below (SetDIBitsToDevice), allows me to plot the contents to the screen. I want to transfer the contents of m_pBuffer to my own device context (CDC myDC), so that i can use GetBitmapBits and manipulate the date prior to plotting on to the screen. Can anyway point me on how to do this? Do i use SetDIBits, if so, how? CClientDC dc(this); if ( m_pBuffer == NULL ) return ; pBitmapInfoRGB24->bmiHeader.biWidth = ImageSizeX ; pBitmapInfoRGB24->bmiHeader.biHeight = - ImageSizeY; // ------------------------------------------------------------------------ // Transfer the image to display // ------------------------------------------------------------------------ SetDIBitsToDevice ( dc.GetSafeHdc(), 22, 25 , ImageSizeX, ImageSizeY , 0, 0, 0, ImageSizeY , &m_pBuffer , pBitmapInfoRGB24 , DIB_RGB_COLORS); bOnGoingRefresh = false ;

    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