Liberty BASIC Community Forum
« Printing a window on PAPER »

Welcome Guest. Please Login or Register.
Feb 22nd, 2018, 12:25pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Printing a window on PAPER  (Read 865 times)
daSeller
New Member
Image


member is offline

Avatar




PM


Posts: 20
xx Printing a window on PAPER
« Thread started on: Mar 4th, 2003, 4:33pm »

I have not figured out how to print a window on paper
that was made from a Bitmap. It goes thru the motion
(Print #handl "print"), but the results are bad. I don't
get what I'm looking at,, rather, a very small version of
it in the UL of the paper.

How do I print when the window is of type 'window' ???too?
User IP Logged

Alyce Watson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 14923
xx Re: Printing a window on PAPER
« Reply #1 on: Mar 4th, 2003, 5:05pm »

on Mar 4th, 2003, 4:33pm, daSeller wrote:
I have not figured out how to print a window on paper
that was made from a Bitmap. It goes thru the motion
(Print #handl "print"), but the results are bad. I don't
get what I'm looking at,, rather, a very small version of
it in the UL of the paper.

How do I print when the window is of type 'window' huhtoo?


To print from a graphicbox or graphics window, see the two hard-copy graphics printing demos here: http://alyce.hytext.com/Graphics.htm

Or read the article on graphics printing in newsletter #103.

The only way to print a hard copy of a plain window is with api calls. This is explained in the ebook at my site. (URL is in my sig.)

Alyce
User IP Logged

Alyce
Liberty BASIC Workshop - a complete IDE for Liberty BASIC


Alyce's Restaurant
for Liberty BASIC code, tools and references
daSeller
New Member
Image


member is offline

Avatar




PM


Posts: 20
xx Re: Printing a window on PAPER
« Reply #2 on: Mar 4th, 2003, 6:44pm »

Thanx

..\zips\printbmp.zip isn't obtainable; the other is.
I think I need the one missing!
User IP Logged

Alyce Watson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 14923
xx Re: Printing a window on PAPER
« Reply #3 on: Mar 4th, 2003, 7:52pm »

on Mar 4th, 2003, 6:44pm, daSeller wrote:
Thanx

..\zips\printbmp.zip isn't obtainable; the other is.
I think I need the one missing!


I just checked and it's there. Here is the code.

Code:
NoMainWin
WindowWidth=500:WindowHeight=400
Menu #1, "&File","&Print",[printMe],"E&xit",[quit]
Open "Bmp Print" For Graphics_nf_nsb As #1
Print #1, "down; fill white;color red"
Print #1, "backcolor blue;size 3"
Print #1, "place 20 20;boxfilled 240 200"
Print #1, "color cyan; size 10"
Print #1, "place 10 10;box 480 340"
Print #1, "place 55 120;font arial 0 34"
Print #1, "color yellow"
Print #1, "\Hello World!"
Print #1, "flush"
Print #1, "getbmp mybmp 0 0 490 350"
BmpSave "mybmp","test.bmp"
Print #1, "trapclose [quit]"

Wait
[quit]
UnloadBmp "mybmp"
kill "test.bmp"
Close #1:End

[printMe]
Call ShellExecutePrintBmp hWnd(#1), DefaultDir$+"\test.bmp"
Wait

Sub ShellExecutePrintBmp hWnd, file$
    parameter = _SW_HIDE        ' hide the window
    lpszOp$ = "print" + Chr$(0) ' "open" or "print"
    lpszFile$ = file$ + Chr$(0)
    lpszDir$ = DefaultDir$ + Chr$(0)
    lpszParams$="" + Chr$(0)
    CallDLL #shell32, "ShellExecuteA", hWnd As long,_
    lpszOp$ As ptr,lpszFile$ As ptr,_
    lpszParams$ As ptr,lpszDir$ As ptr,_
    parameter As long, result As long
    End Sub


 
User IP Logged

Alyce
Liberty BASIC Workshop - a complete IDE for Liberty BASIC


Alyce's Restaurant
for Liberty BASIC code, tools and references
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls