Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Printing a TDrawGrid

I have written a picture viewer (Delphi 6 Pro) and found Drawgrid to be ideal as a method of collecting the vaious bitmaps I wish to display, and presenting it on the screen.

Now I would like to print this (using QuickReport) by copying the whole drawgrid canvas into a QRImage component.

Unfortunately, the Drawgrid doesn't seem to have a Canvas.bitmap property, so I can't copy it it using a command like...

[code]QRImage1.Canvas.Draw(0,0,Drawgrid.Canvas.???[/code]

Can anyone suggest how I might copy my Drawgrid canvas into Quickreport ?

many thanks
Gazza

Comments

  • zibadianzibadian Member Posts: 6,349
    : I have written a picture viewer (Delphi 6 Pro) and found Drawgrid to be ideal as a method of collecting the vaious bitmaps I wish to display, and presenting it on the screen.
    :
    : Now I would like to print this (using QuickReport) by copying the whole drawgrid canvas into a QRImage component.
    :
    : Unfortunately, the Drawgrid doesn't seem to have a Canvas.bitmap property, so I can't copy it it using a command like...
    :
    : [code]QRImage1.Canvas.Draw(0,0,Drawgrid.Canvas.???[/code]
    :
    : Can anyone suggest how I might copy my Drawgrid canvas into Quickreport ?
    :
    : many thanks
    : Gazza
    :
    Try the Assign()ing the grid's canvas to the report canvas.
  • GarryPaxtonGarryPaxton Member Posts: 66
    : : I have written a picture viewer (Delphi 6 Pro) and found Drawgrid to be ideal as a method of collecting the vaious bitmaps I wish to display, and presenting it on the screen.
    : :
    : : Now I would like to print this (using QuickReport) by copying the whole drawgrid canvas into a QRImage component.
    : :
    : : Unfortunately, the Drawgrid doesn't seem to have a Canvas.bitmap property, so I can't copy it it using a command like...
    : :
    : : [code]QRImage1.Canvas.Draw(0,0,Drawgrid.Canvas.???[/code]
    : :
    : : Can anyone suggest how I might copy my Drawgrid canvas into Quickreport ?
    : :
    : : many thanks
    : : Gazza
    : :
    : Try the Assign()ing the grid's canvas to the report canvas.
    :


    Did I understand this correctly ? I tried...
    [code] QRImage.Canvas.Assign(Drawgrid.Canvas) [/code]

    Compiles ok, but get error msg at run time....
    EConvertError...'Cannot assign a TControlCanvas to a TBitmapCanvas'
  • zibadianzibadian Member Posts: 6,349
    : : : I have written a picture viewer (Delphi 6 Pro) and found Drawgrid to be ideal as a method of collecting the vaious bitmaps I wish to display, and presenting it on the screen.
    : : :
    : : : Now I would like to print this (using QuickReport) by copying the whole drawgrid canvas into a QRImage component.
    : : :
    : : : Unfortunately, the Drawgrid doesn't seem to have a Canvas.bitmap property, so I can't copy it it using a command like...
    : : :
    : : : [code]QRImage1.Canvas.Draw(0,0,Drawgrid.Canvas.???[/code]
    : : :
    : : : Can anyone suggest how I might copy my Drawgrid canvas into Quickreport ?
    : : :
    : : : many thanks
    : : : Gazza
    : : :
    : : Try the Assign()ing the grid's canvas to the report canvas.
    : :
    :
    :
    : Did I understand this correctly ? I tried...
    : [code] QRImage.Canvas.Assign(Drawgrid.Canvas) [/code]
    :
    : Compiles ok, but get error msg at run time....
    : EConvertError...'Cannot assign a TControlCanvas to a TBitmapCanvas'
    :
    That was the idea, but looking at the source-code of the various TCanvas objects I just now realized that it is impossible to assign canvases to eachother.
    You can also try to use CopyRect() to copy the grid into the report.
Sign In or Register to comment.