Page 1 of 1

TGraph printing

PostPosted: Wed Aug 31, 2011 1:12 am
by James Bott
I find that when using the Print method of the TGraph class, I get a printout so faint that you can barely see it. When I just print a dialog containing the chart it looks bright, but I want to print it larger, in landscape mode, and centered on the page. Any ideas?

James

Re: TGraph printing

PostPosted: Sat Sep 03, 2011 1:32 am
by jll-fwh
Hi James:

sorry, my English is terrible, but it wrong:

Comentare en español:
Yo lo que hago es realizar un volcado de la imagen al disco y luego en el procedimiento de impresion la cargo y la imprimo con las dimensiones que quiero, y se ve perfecto:

[img]
http://www.grupes.es/basura/grafico1.jpg
[/img]

La impresion de la imagen asi:
Code: Select all  Expand view

   If lGraf
      /* Declaracion de :SayImage( nRow, nCol, oImage, nWidth, nHeight, nRaster ) */
      oImagen:= TImage():Define( ,cFileBMP )
      oPrn:SayImage( 700, 640, oImagen, 3800, 2000 )
      oImagen:End()
      nRow+=8.2
   End

 


El volcado a disco lo hago asi:
Code: Select all  Expand view

/*------------------------------------------------------------------------------*/
STATIC Function Imprimir( oDlg )
/*------------------------------------------------------------------------------*/

    LOCAL cFileName := CurDrive() + ":\" + GetCurDir() +;
                       "
\graficos\EC" + AllTrim( CriaMano->CodAve ) + ".BMP"

    If File( cFileName )
       FErase( cFileName )
    End

    oChart:Save2Bmp( cFileName )

    cValid := .T.
    oDlg:End()
    ListaGrafECM( "
P", aDetalles, "", cFileName )

Return NIL



Espero que sea lo que buscabas.

Un saludo
JLL

Re: TGraph printing

PostPosted: Sat Sep 03, 2011 11:18 pm
by James Bott
JLL,

Thanks for responding. I had already tried that but the BMP that is saved is showing the left side of the image on the right side and visa versa.

This must be a bug in the save2bmp() method. I am using FWH ver 10.08 with xHarbour.

James

Image

Uploaded with ImageShack.us

Re: TGraph printing

PostPosted: Wed Sep 07, 2011 2:34 pm
by James Bott
OK, I obtained two updated C files which fixed the Save2Bmp() method so the bitmap is saved correctly (FWH versions 10.10+ contain this fix). Now I can print using this workaround. I did have to change the background color of the chart to white from the default grey color (oGraph:nClrPane = CLR_WHITE). There is still a faint border line around the chart which is an artifact of the saving the dialog display. I would rather not have this.

I think the problem with the TGraph Print() method is that the pen width is only 1. It needs to be 3 or 4 probably. It would be really nice to have the Print() method fixed rather than using the workaround.

Regards,
James