Ying Wang
April 30th, 1999, 02:30 AM
Sir,
please tell me how to use the MetaFile File?
I can use the CMetaFileDC And the some Functions such as GetEnhMetaFile,
GetEnhMetaFileHeader and so on in VC6.0 to get some information from the
MetaFile file named "meta.emf",
but ,I can't use the information,because it's NULL!!!
now.this is my program:
HENHMETAFILE hemf=GetEnhMetaFile("meta.emf");
LPENHMETAHEADER lpmetahead=NULL;
UINT size=GetEnhMetaFileHeader(hemf,16384 ,lpmetahead);
but ,the variable size is NULL,and the pointer lpmetahead is NULL too.
I am puzzled. Because i tracke the program use Debug in VC6.0,I find the hemf is
not NULL.
how can i do?
I want to know what a MetaFile draw? how can i know it?
I mean my friend give me a file of MetaFile named meta.emf,I want to know what
my friend draw in the file.And I want use a program to judge what is draw in the file
automatically,How can i build the program?
At first, I want to judge the Description in the File.But I find the VC can't add the
Description in the file in convenience,the meta.emf has not Description.
so, i program to add the description, this is the code:
CRect rc;
GetClientRect(&rc);
HENHMETAFILE hMF;
CMetaFileDC dc;
BOOL bCreated =
dc.CreateEnhanced(
pDC,
"m1.emf",
0,
"XYZ Graphics Editor\0Bald Eagle\0\0"
);
if (!bCreated) return;
hMF=GetEnhMetaFile("meta.emf");
if (hMF==NULL) return;
PlayEnhMetaFile(dc.GetSafeHdc(),hMF,&rc);
HENHMETAFILE hemf= dc.CloseEnhanced();
pDC->PlayMetaFile(hemf, &rc);
pDC->SaveDC();
pDC->RestoreDC(-1);
if (hemf)
::DeleteEnhMetaFile(hemf);
so, i create a new file named m1.emf which is added the description.
but when i want to get the description string from the m1.emf ,i find it's none!!!!!
I use :
LPTSTR as;
hemf=GetEnhMetaFile("m1.emf");
if (hemf==NULL) return;
GetEnhMetaFileDescription(hemf,100000,as);
But i find the variable as can't be TextOut,and it's NULL!!!!!
why???
but how can i accomplish my idear?
please help me!
thanks!
by the way:
I am in China,I am chinese,so I connect the homepage so slowly.I wish you can mail to me.
my Email is
garden_wood@263.net
If you have some example about MetaFIle,would you are so kind to please give me a copy?
thanks.
//hehe My English is so poor, please don't laugh at me.
thanks!
please tell me how to use the MetaFile File?
I can use the CMetaFileDC And the some Functions such as GetEnhMetaFile,
GetEnhMetaFileHeader and so on in VC6.0 to get some information from the
MetaFile file named "meta.emf",
but ,I can't use the information,because it's NULL!!!
now.this is my program:
HENHMETAFILE hemf=GetEnhMetaFile("meta.emf");
LPENHMETAHEADER lpmetahead=NULL;
UINT size=GetEnhMetaFileHeader(hemf,16384 ,lpmetahead);
but ,the variable size is NULL,and the pointer lpmetahead is NULL too.
I am puzzled. Because i tracke the program use Debug in VC6.0,I find the hemf is
not NULL.
how can i do?
I want to know what a MetaFile draw? how can i know it?
I mean my friend give me a file of MetaFile named meta.emf,I want to know what
my friend draw in the file.And I want use a program to judge what is draw in the file
automatically,How can i build the program?
At first, I want to judge the Description in the File.But I find the VC can't add the
Description in the file in convenience,the meta.emf has not Description.
so, i program to add the description, this is the code:
CRect rc;
GetClientRect(&rc);
HENHMETAFILE hMF;
CMetaFileDC dc;
BOOL bCreated =
dc.CreateEnhanced(
pDC,
"m1.emf",
0,
"XYZ Graphics Editor\0Bald Eagle\0\0"
);
if (!bCreated) return;
hMF=GetEnhMetaFile("meta.emf");
if (hMF==NULL) return;
PlayEnhMetaFile(dc.GetSafeHdc(),hMF,&rc);
HENHMETAFILE hemf= dc.CloseEnhanced();
pDC->PlayMetaFile(hemf, &rc);
pDC->SaveDC();
pDC->RestoreDC(-1);
if (hemf)
::DeleteEnhMetaFile(hemf);
so, i create a new file named m1.emf which is added the description.
but when i want to get the description string from the m1.emf ,i find it's none!!!!!
I use :
LPTSTR as;
hemf=GetEnhMetaFile("m1.emf");
if (hemf==NULL) return;
GetEnhMetaFileDescription(hemf,100000,as);
But i find the variable as can't be TextOut,and it's NULL!!!!!
why???
but how can i accomplish my idear?
please help me!
thanks!
by the way:
I am in China,I am chinese,so I connect the homepage so slowly.I wish you can mail to me.
my Email is
garden_wood@263.net
If you have some example about MetaFIle,would you are so kind to please give me a copy?
thanks.
//hehe My English is so poor, please don't laugh at me.
thanks!