Page 1 of 1

How to impemented varius pen in a printer object

Posted: Sat Nov 19, 2005 11:35 pm
by Sakis
Hello FiveWiners
I have the following code :

Code: Select all

// Printing in portrait and in landscape

#include "fivewin.ch"
#INCLUDE "COLORS.CH"

#define PAD_LEFT            0
#define PAD_RIGHT           1
#define PAD_CENTER          2


function Main()
  local oPrn, oFont, oPen1 , oPen2
   Local nLinI, nColI, nLinF, nColF
 
    
    
     PRINT oPrn NAME "Εκτύπωση σε LandScape..." PREVIEW
    DEFINE PEN oPen1 WIDTH  2  OF oPrn
    DEFINE PEN oPen2 WIDTH  6  OF oPrn 
    oFont:= Tfont():New ( ,,,.T.,,,,,,,,,,,,oPrn) 
    
      oPrn:SetPage(9)  //a4
      oPrn:SetLandscape() // HORIZONTAL
      
      PAGE
         nLinI :=  2.3
         nColI :=  1.3
         nLinF := 19.5
         nColF := 28.5
         oPrn:Cmtr2Pix(@nLinI, @nColI)
         oPrn:cmtr2Pix(@nLinF, @nColF)
         oPrn:Box(nLinI, nColI, nLinF, nColF, oPen2)
         oPrn:CmSay(1.5,13,"CUSTOMER FILE" , oFont,,CLR_BLACK,,PAD_CENTER)
         nLinI:=3.3
         nColI:=9.5
         nLinF:=10.5
         nColF:=9.5
         oPrn:Cmtr2Pix(@nLinI, @nColI)
         oPrn:cmtr2Pix(@nLinF, @nColF)
         oPrn:Line(nLinI, nColI, nLinF, nColF,oPen1)
         nRStart:=0.9
         nCStart:=1.5
         oPrn:Cmtr2Pix(@nRstart, @nCstart)
         oPrn:SayBitMap(nRStart,nCstart,"C:\TEMP\1st.bmp",3.4,0.65)
         nRStart:=0.9
         nCStart:=25
         oPrn:Cmtr2Pix(@nRStart,@nCStart)
         oPrn:SayBitMap(nRStart,nCStart,"C:\TEMP\Container.bmp",1.2,0.65)
         
      ENDPAGE
 
 oPen1:End()
 oPen2:end()
 oFont:End()

   ENDPRINT
 
return nil
And the two definable pens with different widths not shown correctly on the preview or the final printing . The final print out consist from a thin pen (oPen1) only.

What can i do for this?

Any help would be appreciate..
Thanks in advance
Dionisis

Re: How to impemented varius pen in a printer object

Posted: Sun Nov 20, 2005 10:18 am
by Enrico Maria Giordano
The preview deals with pixels not with printer points. Try to increase the pen width and you'll see the difference.

EMG

How to impemented varius pen in a printer object

Posted: Sun Nov 20, 2005 4:09 pm
by Sakis
Deal Enrico

Many thanks for your answer. As always you have 100% right. You heat into the spot.

Many thanks again.

Regards
Dionisis :D