archive-com.com » COM » E » EFG2.COM

Total: 878

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".

  • 99 Code hacked together from SWAG SWAG WEB Site http www gdsoft com swag swag html SWAG FTP Site ftp gdsoft com pub swag About SWAG SWAG is a collection of source code and program examples for the PASCAL program language The material has been donated by various PASCAL programmers from around the world interested in the continued advancement of one of the finest programming platforms available today unit PrinterStatus interface uses Windows Messages SysUtils Classes Graphics Controls Forms Dialogs type TPrinterStatus class TComponent private Private declarations FPort Word FStatusStr string protected Protected declarations public Public declarations function PrinterReady LPT Word boolean published Published declarations property StatusMsg string read FStatusStr end procedure Register implementation uses Printers procedure Register begin RegisterComponents Win95 TPrinterStatus end const PrnReady 90 OffLine 00 OffLine2 10 NEW LINE PaperOut 20 PaperOut2 30 NEW LINE HookedButOff 80 NEW LINE NoConnect B0 MODIFIED LINE NOCONNECT 30 FOR SOME COMPUTERS BY STU function TPrinterStatus PrinterReady LPT Word boolean var ErrorCode C BYTE code x integer s string function GetPrinterStatus LPT Word Byte Pass 1 in LPT for LPT1 begin asm mov ah 2 mov dx LPT dec dx int 17 mov Result ah end end GetPrinterStatus begin result false

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1999/0120a.txt (2016-02-14)
    Open archived version from archive



  • tf TFont begin with Form1 Canvas do begin Font Name Arial Font Size 24 tf TFont Create tf Assign Font GetObject tf Handle sizeof lf lf lf lfEscapement 450 lf lfOrientation 450 tf Handle CreateFontIndirect lf Font Assign tf tf Free TextOut 20 Height div 2 Rotated Text end end Q How can I reliably rotate a font on a printer A Here is some code that will reliably rotate fonts on any printer providing the printer supports rotating fonts and the font is a TrueType or other rotatable font Example procedure TForm1 Button1Click Sender TObject var lf TLogFont OldFont hFont NewFont hFont begin Printer BeginDoc Printer Canvas Font Name Arial Printer Canvas Font Size 24 Printer Canvas Font PixelsPerInch GetDeviceCaps Printer Canvas Handle LOGPIXELSY GetObject Printer Canvas Font Handle sizeof lf lf lf lfEscapement 450 lf lfOrientation 450 Check here that lf is properly filled out NewFont CreateFontIndirect lf OldFont SelectObject Printer Canvas Handle NewFont Windows TextOut Printer Canvas Handle 200 200 Rotated Text 13 SelectObject Printer Canvas Handle OldFont DeleteObject NewFont Printer EndDoc end Q Some printers seems to rotate the portrait orientation to achieve a landscape page differently than others This seems to affect the direction of a rotated font How can I tell what direction a printer will rotate output on a landscape page and if landscape mode is available on a given printer A The following example demonstrates how to call the Windows API function DeviceCapabilities to find out how a portrait page is rotated to achieve a landscape page enabling you to adjust your output accordingly Example uses Printers IFDEF WIN32 function DeviceCapabilitiesA pDevice PAnsiChar pPort PAnsiChar fwCapability Word pOutput PAnsiChar DevMode PDeviceModeA Integer stdcall stdcall external winspool drv name DeviceCapabilitiesA function DeviceCapabilitiesW pDevice PWideChar pPort PWideChar fwCapability Word pOutput PWideChar DevMode PDeviceModeW Integer

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1999/0107.txt (2016-02-14)
    Open archived version from archive


  • DevMode THandle pDevmode PDeviceMode begin Get printer device name etc Printer GetPrinter Device Driver Port DevMode force reload of DEVMODE Printer SetPrinter Device Driver Port 0 get DEVMODE handle Printer GetPrinter Device Driver Port DevMode If Devmode Nil Then try With pDevmode Do Begin modify paper size dmPapersize DMPAPER A4 tell printer driver that dmPapersize field contains data it needs to inspect dmFields dmFields or DM PAPERSIZE End finally unlock

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/2000/0314.txt (2016-02-14)
    Open archived version from archive


  • Content Type text plain charset us ascii Organization TeamB Mime Version 1 0 Reply To pandeng telepath com Newsgroups borland public delphi graphics On Mon 15 Nov 1999 15 57 22 0700 Darcy Schultz wrote Why isn t psDash psDot psDashDot working on the printer GDI drivers are not required to support line styles other than psSolid and psClear if the line width is anything more than 1 pixel Some

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1999/1116.txt (2016-02-14)
    Open archived version from archive


  • Kennedy Yes it is perhaps possible to change many of the settings of between pages a printjob I thought that I had written a Ti or FAQ detailing how to do this but I am unable to locate it Basically you will need to patch TPrinter to make a callback to a unit that will sit between you and TPrinter This is an interesting workaround I have been told by the father of Delphi himself and other notables that you cannot make changes to TPrinters interface without risking breaking other VCL code The workaround is rather simple Create you intermediate unit and reference it only from the implementation section of TPrinter You want to create a callback to the intermediate unit that occures between every page that is printed You can assign a callback in the intermediate unit from your application so that your callback function in your application will get called whenever the callback funcion in the intermediate unit gets called From there you can get access to the printers DevMode structure and use API functions like ReSetDc to attempt to change the printer setup in between pages ResetDC is pretty good about reporting if the printer supports this escape and if the call fails rarely your application can seperate the pages into individual print jobs Note that most print drivers do support changing the settings between jobs As a technical side note the ResetDC function actually makes an escape call into 16 bit drivers IMHO is not well documented for 16 bit dirvers A further note is that non NT platforms use 16 bit print drivers although some of them are actuall marked as 32 bit dlls A well implemenated unit can make it very painless to use these features without ever touching the interface section of TPrinter

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1999/0121b.txt (2016-02-14)
    Open archived version from archive


  • are slow to come and their new drivers are still max 98 compatible that s what they call the Windows ME driver too If a Delphi program uses the PrintDialog component and the user does not have an updated HP driver because he never upgraded or because he uses Windows ME the PrintDialog component will generate an error message and abort printing Once you disable the dialogue and use the

    Original URL path: http://www.efg2.com/Lab/Library/Delphi/Printing/StevePhilipp_HPPrinters.TXT (2016-02-14)
    Open archived version from archive


  • Canvas TCanvas DestRect TRect Bitmap TBitmap VAR BitmapHeader pBitmapInfo BitmapImage POINTER HeaderSize INTEGER IFDEF WIN32 ImageSize INTEGER ELSE ImageSize LongInt ENDIF BEGIN GetDIBSizes Bitmap Handle HeaderSize ImageSize GetMem BitmapHeader HeaderSize GetMem BitmapImage ImageSize TRY GetDIB Bitmap Handle Bitmap Palette BitmapHeader BitmapImage StretchDIBits Canvas Handle DestRect Left DestRect Top Destination Origin DestRect Right DestRect Left Destination Width DestRect Bottom DestRect Top Destination Height 0 0 Source Origin Bitmap Width Bitmap Height

    Original URL path: http://www.efg2.com/Lab/Library/Delphi/Printing/D1PrintBitmap.TXT (2016-02-14)
    Open archived version from archive


  • BitmapHeader void BitmapImage GetDIBSizes AnalyzerPlotForm AnalyzerDisplayImage Picture Bitmap Handle HeaderSize ImageSize BitmapHeader BITMAPINFO malloc HeaderSize BitmapImage void malloc ImageSize GetDIB AnalyzerPlotForm AnalyzerDisplayImage Picture Bitmap Handle AnalyzerPlotForm AnalyzerDisplayImage Picture Bitmap Palette BitmapHeader BitmapImage Printer BeginDoc StretchDIBits Printer Canvas Handle ARect Left ARect Top ARect Right ARect Bottom 0 0 128 Analyzer display width 64 Analyzer display height BitmapImage BitmapHeader DIB RGB COLORS SRCCOPY Printer EndDoc Thanks Mike Earl F Glynn wrote

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/2001/0220.txt (2016-02-14)
    Open archived version from archive



  •