Re: getting the canvas of iupplot and print it

new topic     » goto parent     » topic index » view thread      » older message » newer message
begin said...

I can't get the canvas or image if iupplot and print it.

my application plots just fine, but i need to print the plot. so i took from pete's samples

I haven't done much of this, but you should be on the right track with IupPlotPaintTo().

You don't have an imImage with IupPlot, so let's rip all that out. Try this (untested):

function item_print_action_cb(Ihandle /*item_print*/) 
cdCanvan print_canvas = cdCreateCanvas(CD_PRINTER, "myplot -d") 
    if print_canvas!=NULL then 
        IupPlotPaintTo(plot, print_canvas) 
        IupSetAttribute(plot,"REDRAW",NULL) 
        cdKillCanvas(print_canvas) 
    end if 
    return IUP_DEFAULT 
end function 

If it does not work, and I find time tomorrow, I'll have a bash at adding this to the plot demo.

Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu