TGraph printing

TGraph printing

Postby James Bott » Wed Aug 31, 2011 1:12 am

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: TGraph printing

Postby jll-fwh » Sat Sep 03, 2011 1:32 am

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
Libreria: FWH/FWH1109 + Harbour 5.8.2 + Borland C++ 5.8.2
Editor de Recursos: PellecC
ADA, OURXDBU
S.O: XP / Win 7 /Win10
Blog: http://javierlloris.blogspot.com.es/
e-mail: javierllorisprogramador@gmail.com
User avatar
jll-fwh
 
Posts: 408
Joined: Fri Jan 29, 2010 8:14 pm
Location: Meliana - Valencia

Re: TGraph printing

Postby James Bott » Sat Sep 03, 2011 11:18 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: TGraph printing

Postby James Bott » Wed Sep 07, 2011 2:34 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 111 guests