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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Way to Store and Retrive Metafile Info

Way to Store and Retrive Metafile Info

Scheduled Pinned Locked Moved C / C++ / MFC
2 Posts 2 Posters 1 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
    anilksingh
    wrote on last edited by
    #1

    TMetafile *pMetafile = new TMetafile; TMetafileCanvas *pCanvas = new TMetafileCanvas(pMetafile, 0); pCanvas->Brush->Color = clRed; pCanvas->Ellipse(0,0,100,100); FILE *fpW; fpW=fopen("h","wb") ; fwrite(pMetafile,sizeof(*pMetafile),1,fpW); fclose(fpW); delete pCanvas; delete pMetafile;//If we comment this statement Ellipse is not drawn TMetafile *pMetafile1 = new TMetafile; fpW=fopen("h","rb"); fread(pMetafile1,sizeof(*pMetafile1),1,fpW); fclose(fpW) ; Form1->Canvas->Draw(0,0,pMetafile1); If the pMetafile is deleted after saving the data into file then the code will not draw Ellipse. Is it there any way to store and retrive the Metafile Info.

    F 1 Reply Last reply
    0
    • A anilksingh

      TMetafile *pMetafile = new TMetafile; TMetafileCanvas *pCanvas = new TMetafileCanvas(pMetafile, 0); pCanvas->Brush->Color = clRed; pCanvas->Ellipse(0,0,100,100); FILE *fpW; fpW=fopen("h","wb") ; fwrite(pMetafile,sizeof(*pMetafile),1,fpW); fclose(fpW); delete pCanvas; delete pMetafile;//If we comment this statement Ellipse is not drawn TMetafile *pMetafile1 = new TMetafile; fpW=fopen("h","rb"); fread(pMetafile1,sizeof(*pMetafile1),1,fpW); fclose(fpW) ; Form1->Canvas->Draw(0,0,pMetafile1); If the pMetafile is deleted after saving the data into file then the code will not draw Ellipse. Is it there any way to store and retrive the Metafile Info.

      F Offline
      F Offline
      Fundoo7
      wrote on last edited by
      #2

      Try sizeof(TMetafile),looks like you did not save the metafile. Best Regards, Deepu

      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