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. metafile to bitmap

metafile to bitmap

Scheduled Pinned Locked Moved C / C++ / MFC
graphicstutorialquestion
5 Posts 3 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.
  • H Offline
    H Offline
    haipengl
    wrote on last edited by
    #1

    Does anyone know how to convert metafile to bitmap?

    L F 2 Replies Last reply
    0
    • H haipengl

      Does anyone know how to convert metafile to bitmap?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Larry, I can't tell you from experience, but as I understand it you simply "play" the metafile into a DC and then use standard techniques to save the DC to a .bmp file.

      1 Reply Last reply
      0
      • H haipengl

        Does anyone know how to convert metafile to bitmap?

        F Offline
        F Offline
        Feng Yuan
        wrote on last edited by
        #3

        Create a DIB section and a memory DC, select the DIB section into the memory DC, play the metafile into memory DC, now you got a bitmap in the DIB section. http://www.amazon.com/exec/obidos/ASIN/0130869856

        H 1 Reply Last reply
        0
        • F Feng Yuan

          Create a DIB section and a memory DC, select the DIB section into the memory DC, play the metafile into memory DC, now you got a bitmap in the DIB section. http://www.amazon.com/exec/obidos/ASIN/0130869856

          H Offline
          H Offline
          haipengl
          wrote on last edited by
          #4

          thanks for you both. I am not good in graphic design. I have some code here. I am trying to save Meta to BMP. But I only get black area. please help. larry if ( OpenClipboard() ) { HENHMETAFILE handle = (HENHMETAFILE)GetClipboardData(CF_ENHMETAFILE); CClientDC dc(this); CRect client(0,0,500,500); CBitmap * bmf = new CBitmap(); CDC mdc; mdc.CreateCompatibleDC(&dc); bmf->CreateCompatibleBitmap(&dc,client.Width(),client.Height()); PlayEnhMetaFile(dc, handle, &client); dc.SelectObject(bmf); SetClipboardData(CF_BITMAP,bmf->m_hObject); CloseClipboard(); }

          F 1 Reply Last reply
          0
          • H haipengl

            thanks for you both. I am not good in graphic design. I have some code here. I am trying to save Meta to BMP. But I only get black area. please help. larry if ( OpenClipboard() ) { HENHMETAFILE handle = (HENHMETAFILE)GetClipboardData(CF_ENHMETAFILE); CClientDC dc(this); CRect client(0,0,500,500); CBitmap * bmf = new CBitmap(); CDC mdc; mdc.CreateCompatibleDC(&dc); bmf->CreateCompatibleBitmap(&dc,client.Width(),client.Height()); PlayEnhMetaFile(dc, handle, &client); dc.SelectObject(bmf); SetClipboardData(CF_BITMAP,bmf->m_hObject); CloseClipboard(); }

            F Offline
            F Offline
            Feng Yuan
            wrote on last edited by
            #5

            Select bitmap into the memory DC before drawing.

            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