HELP MM to Pixel conversion

HELP MM to Pixel conversion

Postby devwin2004 » Fri Feb 17, 2006 2:24 am

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
 
Posts: 42
Joined: Mon Dec 05, 2005 1:27 am

Postby Rafael Clemente » Fri Feb 17, 2006 7:44 am

Just scan at 70 dpi and you will get an image of approx. 800 x 600 pixel. However, I suspect that it will be barely readable on the screen and too low in quality for printing full size.
Is this what you needed?
Rafael
User avatar
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Re: HELP MM to Pixel conversion

Postby Romeo » Mon Feb 22, 2010 7:04 pm

hi,
CAN YOU HELP ME TO GET DPI from a generic bmp files ?
tks
Romeo
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: HELP MM to Pixel conversion

Postby FiveWiDi » Tue Feb 23, 2010 4:40 pm

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


Perhaps, this can help you:
Code: Select all  Expand view
#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 


Regards
Carlos G.
Un Saludo
Carlos G.

FiveWin 24.02 + Harbour 3.2.0dev (r2403071241), BCC 7.7 Windows 10
FiveWiDi
 
Posts: 1083
Joined: Mon Oct 10, 2005 2:38 pm

Re: HELP MM to Pixel conversion

Postby Silvio » Tue Feb 23, 2010 5:58 pm

Certainly this is very strange because all I have always said that I could see a white window, with the measures expressed in cm in pixels simulating a page printer, if not with the state an object instead oprn with these functions can be done now perhaps better with mine designer report
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 24 guests