?
Solved

combine 2 metafile drawings?

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

thanks
0
Comment
Question by:kirez
1 Comment
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 1000 total points
ID: 13785550
This is from memory, not tested since I do not have any metafiles handy
hope it's correct and helps,
Loki

uses math;

procedure TForm1.BitBtn1Click(Sender: TObject);
     var
         m1, m2 : TmetaFile;
         mc : TmetaFileCanvas;
         b : tbitmap;
    begin
        m1 := TMetaFile.Create;
        m2 := TMetaFile.Create;
        try
            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
        finally
            mc.Free;
            m1.free;
            m2.free;
        end;
        Image1.Picture.LoadFromFile('c:\pic3.wmf');
    end;
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Screencast - Getting to Know the Pipeline
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

839 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