How reduce the size of metafile in printer

How reduce the size of metafile in printer

Postby vensanto » Wed Jan 04, 2006 6:56 pm

Help!

How to reduce the size of a metafile using the metod

oPRINT:ImportWMF("Layout")

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

I have solved the problem

Postby vensanto » Fri Jan 06, 2006 11:37 am

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"
User avatar
vensanto
 
Posts: 58
Joined: Thu Oct 13, 2005 1:26 pm
Location: ITALIA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 97 guests