How reduce the size of metafile in printer

Post Reply
User avatar
vensanto
Posts: 54
Joined: Thu Oct 13, 2005 1:26 pm
Location: ITALIA
Contact:

How reduce the size of metafile in printer

Post by vensanto »

Help!

How to reduce the size of a metafile using the metod

oPRINT:ImportWMF("Layout")

???
User avatar
vensanto
Posts: 54
Joined: Thu Oct 13, 2005 1:26 pm
Location: ITALIA
Contact:

I have solved the problem

Post by vensanto »

I have created the method EMF( cfile, right, left, top, bottom )

METHOD EMF( cFile, left, right, top, bottom ) CLASS TPrinter

Local hMeta,oRect
Local aData:=PrnGetSize( ::hDC )

IF ! FILE( cFile )
Return nil
Endif

SaveDC( ::hDCOut )

hMeta:=GetEnhMetaFile( cFile )

::SetIsoTropicMode()
::SetWindowExt( aData[1], aData[2] )
::SetViewPortExt( aData[1], aData[2] )
SetViewOrg( ::hDCOut, -1, -1 )

STRUCT oRect
MEMBER nLeft AS LONG
MEMBER nTop AS LONG
MEMBER nRight AS LONG
MEMBER nBottom AS LONG
ENDSTRUCT

oRect:nLeft := left
oRect:nTop := top
oRect:nRight := aData[1] - right - ::nXoffset - ::nXoffset
oRect:nBottom := aData[2] - bottom - ::nYoffset - ::nYoffset

SetBkMode( ::hDCOut, 1 )

PlayEMF( ::hDCOut, hMeta, oRect:cBuffer , .T. )

DeleteEnhMetafile( hMeta )

RestoreDC( ::hDCOut )

Return nil



DLL32 FUNCTION PLAYEMF( hDC AS LONG, hEMF AS LONG, cRect AS LPSTR ) AS BOOL;
PASCAL FROM "PlayEnhMetaFile" LIB "gdi32.dll"
Post Reply