Dear coleague
I need an example to convert de 297.4 mm x 210,0 mm to pixel or viceversa in 800 x 600 screen resolution Somebody have one to
send me or tell me how can i do that
Thanks
Dante
devwin2004@yahoo.com.ar
devwin2004 wrote:Dear coleague
I need an example to convert de 297.4 mm x 210,0 mm to pixel or viceversa in 800 x 600 screen resolution Somebody have one to
send me or tell me how can i do that
Thanks
Dante
devwin2004@yahoo.com.ar
#include "FiveWin.ch"
#define HORZSIZE 4
#define VERTSIZE 6
#define HORZRES 8
#define VERTRES 10
#define LOGPIXELSX 88
#define LOGPIXELSY 90
/* ****************************************************************************
Funciones para convertir PIXEL a Twip/Pulgadas/Centímetros y viceversa.
hDC -> oWnd:hDC or oPrn:hDC
************************************************************************* */
/* ******************************************************* */
FUNCTION nPixels2Twips( hDC, nPixels, lVertical )
Return (nPixels / GetDeviceCaps( hDC, If(lVertical, LOGPIXELSY, LOGPIXELSX) ) ) * 1440
/* ******************************************************* */
FUNCTION nTwips2Pixels( hDC, nTwips, lVertical )
Return (nTwips / 1440) * GetDeviceCaps( hDC, If(lVertical, LOGPIXELSY, LOGPIXELSX) )
/* ******************************************************* */
FUNCTION nPixels2Inches( hDC, nPixels, lVertical )
Return (nPixels / GetDeviceCaps( hDC, If(lVertical, LOGPIXELSY, LOGPIXELSX) ) )
/* ******************************************************* */
FUNCTION nInches2Pixels( hDC, nInches, lVertical )
Return (nInches * GetDeviceCaps( hDC, If(lVertical, LOGPIXELSY, LOGPIXELSX) ) )
/* ******************************************************* */
FUNCTION nPixels2Cm( hDC, nPixels, lVertical )
Return nPixels2Inches( hDC, nPixels, lVertical ) * 2.54
/* ******************************************************* */
FUNCTION nCm2Pixels( hDC, nCm, lVertical )
Return nInches2Pixels( hDC, (nCm / 2.54), lVertical )
/* ******************************************************* */
FUNCTION uCm2Pixels( HdC, nCmy, nCmx )
nCmy := nCm2Pixels( hDC, nCmy, .T. )
nCmx := nCm2Pixels( hDC, nCmx, .F. )
Return Nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 25 guests