Author |
Topic: Drawing lines (Read 795 times) |
|
Monkfish
Full Member
member is offline


Gender: 
Posts: 104
|
 |
Re: Drawing lines
« Reply #5 on: Jul 25th, 2015, 07:24am » |
|
Cool. I will give it a go.
The main reason I want to draw everything twice the size (including the font size) is that I want to increase the quality of my printouts. Although 8pt text is acceptable, 16pt would look better (but too large to use on the screen because it would make the overall image too big). I might not even want to display the double size image on the screen, just send it to the printer. I expect that is possible?
|
|
Logged
|
|
|
|
Rod
Full Member
member is offline


Gender: 
Posts: 110
|
 |
Re: Drawing lines
« Reply #6 on: Jul 25th, 2015, 07:41am » |
|
To get the best out of your printer you need lots of pixels.
Imagine a graphic box 2100 pixels wide and 2950 pixels high. Now fill it with graphics or text and use print 2100 to send it to the printer.
That will get you good quality high resolution graphics. You don't need to be able to see all of the graphicbox on screen.
http://lbpe.wikispaces.com/GraphicPrinting2
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Drawing lines
« Reply #7 on: Jul 25th, 2015, 09:55am » |
|
on Jul 25th, 2015, 07:41am, Rod wrote:| To get the best out of your printer you need lots of pixels. |
|
Yes indeed. In fact, ideally, you should have as many pixels in your graphic as the printer has 'dots'. So for example if you want to print an 8" wide graphic at 300 DPI quality, you really want a graphic which is 2400 pixels wide!
Note that in LBB you cannot, by default, have a graphics canvas wider than your entire screen, but that is easily overcome by using the horizscrollbar command (depending on the height of your graphic you may need to use vertscrollbar too):
Code: open "High quality printing" for graphics_nsb as #w
#w "horizscrollbar on 0 2400"
#w "font Arial 0 120"
#w "\\\ This should be printed in really high quality!"
#w "print 2400"
wait Quote: To make the example program there work correctly in LBB you need to add this before the graphics are drawn:
Code:#1.g "horizscrollbar on 0 ";ImageWidth
#1.g "vertscrollbar on 0 ";ImageHeight on Jul 25th, 2015, 07:24am, Monkfish wrote:| I might not even want to display the double size image on the screen, just send it to the printer. I expect that is possible? |
|
You could hide the graphicbox, or move it out of view:
Code: graphicbox #w.gb, 400, 0, 1, 1
open "High quality printing" for graphics_nsb as #w
#w.gb "horizscrollbar on 0 2400"
#w.gb "font Arial 0 120"
#w.gb "\\\ This should be printed in really high quality!"
#w.gb "print 2400"
wait Richard.
|
|
|
|
Monkfish
Full Member
member is offline


Gender: 
Posts: 104
|
 |
Re: Drawing lines
« Reply #8 on: Jul 25th, 2015, 8:34pm » |
|
Thanks guys
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Drawing lines
« Reply #9 on: Jul 25th, 2015, 9:56pm » |
|
On a related point, somebody at the Yahoo! group has asked how to make the ends of a 'thick' line flat rather than rounded. Nobody there seems to know the answer, but it's not difficult (this works in both LB and LBB):
Code: open "Line endcap" for graphics_nsb as #w
thickness = 12
#w "down; size ";thickness
#w "line 50 100 250 150"
hw = hwnd(#w)
calldll #user32, "GetDC", hw as ulong, hdc as ulong
struct logbrush, lbStyle as ulong, lbColor as ulong, lbHatch as ulong
penstyle = _PS_GEOMETRIC or _PS_ENDCAP_FLAT
calldll #gdi32, "ExtCreatePen", penstyle as long, thickness as long, _
logbrush as struct, 0 as long, 0 as long, pen as ulong
calldll #gdi32, "SelectObject", hdc as ulong, pen as ulong, old as ulong
#w "line 50 200 250 250"
calldll #gdi32, "SelectObject", hdc as ulong, old as ulong, pen as ulong
calldll #gdi32, "DeleteObject", pen as ulong, ret as void
wait Changing _PS_ENDCAP_FLAT to _PS_ENDCAP_SQUARE lengthens the line, but the ends remain straight.
Richard.
|
|
|
|
|