combine 2 metafile drawings?

Posted on 2005-04-14
Last Modified: 2010-04-05
how can i draw object of 1 metafile picture (wmf) to another metafile canvas which is created dinamicly?

Question by:kirez
    1 Comment
    LVL 17

    Accepted Solution

    This is from memory, not tested since I do not have any metafiles handy
    hope it's correct and helps,

    uses math;

    procedure TForm1.BitBtn1Click(Sender: TObject);
             m1, m2 : TmetaFile;
             mc : TmetaFileCanvas;
             b : tbitmap;
            m1 := TMetaFile.Create;
            m2 := TMetaFile.Create;
                m1.LoadFromFile('c:\pic1.wmf'); // or is emf? i forget
    //            m2.LoadFromFile('c:\pic2.wmf');
    // if you want to merge 2 wmf's you could do the above line - I put this in just in case it was handy

                m2.Height := max(m1.Height, m2.height);
                m2.Width := max(m1.Width, m2.Width);
                mc := TMetafileCanvas.Create(m2, 0);
                mc.Draw(0, 0, m1); // draw m1 to m2's canvas
                m2.SaveToFile('c:\pic3.wmf'); // or is emf, i forget

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now