Print a Bitmap


Open a bitmap file from disk as in this example, or use GetBmp to get a bitmap from your own graphics, then use BmpSave to save it to disk. This demo prints a bitmap file on disk using MSPaint.exe, which works invisibly when using the HIDE switch with the RUN command.

Liberty BASIC graphics printouts are dependent upon the resolution of the printer. One pixel from the screen is translated to one dot on the printer, so printers with high resolution print the graphics in a very, very small size. Using MSPaint overcomes this limitation.

filedialog "Open","*.bmp",bmp$
if bmp$="" then end

bmp$=GetShortPathName$(bmp$)
run "mspaint.exe " + bmp$ + " /p", HIDE
end

Function GetShortPathName$(lPath$)
    lPath$=lPath$+Chr$(0)
    sPath$=Space$(256)
    lenPath=Len(sPath$)
    CallDLL #kernel32, "GetShortPathNameA",_
    lPath$ As ptr,sPath$ As ptr,_
    lenPath As long,r As long
    GetShortPathName$=Left$(sPath$,r)
    End Function


Home

Source Code

Utilities

Internet

Games

Graphics

Media Demos

Snippets

DLL's

API Resources

Freeware

LB 4 Companion

Mastering LB 3

LB Workshop

Game Workshop

Links

Index