Print image & contents of RichEdit on one sheet

In this category you can exchange your programming questions and solutions.
Post Reply
Darren
Posts: 63
Joined: Wed May 11, 2011 11:55 am

Print image & contents of RichEdit on one sheet

Post: # 1118Post Darren
Sat Sep 28, 2013 7:54 am

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

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

Print image & contents of RichEdit on one sheet

Post: # 1119Post Marco
Thu Oct 03, 2013 4:23 pm

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

Post Reply