Page 1 of 1

Print image & contents of RichEdit on one sheet

Posted: Sat Sep 28, 2013 7:54 am
by Darren
I have a RichEdit control with various lines of text. I can print the contents of this RichEdit control to the printer OK.

Does anybody know if it is possible to Add a bmp image onto the top of the sheet prior to printing.

Simply put, I want the company logo to be printed every time I print the contentsof the RichEdit control.

Thanks!!!!

Darren

Print image & contents of RichEdit on one sheet

Posted: Thu Oct 03, 2013 4:23 pm
by Marco
hi, maybe this will help you ?

best regards
code:

dim p as printer
dim logo as bitmap
logo.loadfromfile("fnxlogo.bmp")
object f as form
? object r as richedit
? ? addtext("jhgjhghjghj")
? ? addtext("kjkljkljkljkljlkjklj")
? end object
? object b as button
? ? top=f.clientheight-40
? ? caption="print"
? ? onclick=printclick
? end object
? showmodal
end object

sub printclick
? dim y as integer,c as integer
? y=200
? p.canvas.font=r.font
? p.begindoc
? p.canvas.stretchdraw(10,50,200,150,logo)
? for c=0 to r.linecount
? ? p.canvas.textout(60,y,r.line(c),&hffffff)
? ? y=y+p.canvas.textheight(r.line(c))+4
? next c
? p.enddoc
end sub