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. Is there any difference in drawing emf on CDC and Bitmap?

Is there any difference in drawing emf on CDC and Bitmap?

Scheduled Pinned Locked Moved C / C++ / MFC
graphicscomtoolsquestion
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.
  • S Offline
    S Offline
    Sameerkumar Namdeo
    wrote on last edited by
    #1

    Hello Everybody, abc.emf file has some lines and text inside it stored in vector form. Have tried various way of drawing this emf file on Bitmap as follows:

    Metafile metafile("abc.emf");
    height = metafile.GetHeight();
    width = metafile.GetWidth();
    Rect rcdst(0, 0, width, height);
    Bitmap bmp(width, height, PixelFormat32bppARGB)
    Graphics gr(&bmp);
    [1]
    gr.DrawImage(&metafile, rcdst, 0, 0, width, height, UnitPixel);

    [2]
    gr.EnumerateMetafile(&metafile, Point(0, 0), metaCallback, &metafile);
    metaCallback was defined appropriately and inside that used Metafile::PlayRecord() for drawing.

    Now, when i save this bmp in uncompressed format like tif then the quality of text is not coming properly. When i display the same emf file on CDC then the quality of text is proper, means antialised. Please suggest how the quality of emf can be maintained while drawing it on bitmap. Also, highlight any other method through which this can be done. Thanks.

    My Blog.
    My codeproject Articles.

    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