Richard Posted December 27, 2009 Posted December 27, 2009 In the following code snippet the line: _PrintSetFont($hp,'Arial',18,0,'bold,underline') sets the font. The 0 = black. When trying other colors(1,2 ....) the result stays black; Why? Is there a list of available colors? Richard #include 'printMGv2.au3' Global $hp Local $mmssgg,$marginx,$marginy $hp = _PrintDllStart($mmssgg);this must always be called first if $hp = 0 then consolewrite("Error from dllstart = " & $mmssgg & @CRLF) Exit endif $newselect = _PrintSetPrinter($hp) _PrintPageOrientation($hp,1);portrait _PrintSetDocTitle($hp,"This is a test page for PDFcreator No. 01") _PrintStartPrint($hp) $pght = _PrintGetpageheight($hp) - _PrintGetYOffset($hp) $pgwd = _PrintGetpageWidth($hp) - _PrintGetXOffset($hp) _PrintSetFont($hp,'Arial',18,0,'bold,underline') $Title = "This is a test of the printer dll" $tw = _PrintGetTextWidth($hp,$Title) $th = _PrintGetTextHeight($hp,$title) _PrintText($hp,$title,Int($pgwd/2 - $tw/2),_PrintGetYOffset($hp)) _PrintSetFont($hp,'Arial',12,1,'') For $n = 1 To 12 _PrintText($hp,"This is color : " & $n-1,100,100+(70 * $n)) Next _PrintEndPrint($hp) _PrintNewPage($hp); _printDllClose($hp)
Mat Posted December 27, 2009 Posted December 27, 2009 try using "0xFF0000" instead of "0", I think it wants it in RGB form. I haven't tested though :| AutoIt Project Listing
PsaltyDS Posted December 27, 2009 Posted December 27, 2009 (edited) Differences in color of only 1 or 2 in any single field ( R, G, or B ) are going to be very small and hard to detect with the naked eye. So it's not surprising that 0, 1, and 2 all look like the same black. Try larger differences to see the results. Edited December 27, 2009 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
martin Posted December 27, 2009 Posted December 27, 2009 try using "0xFF0000" instead of "0", I think it wants it in RGB form. I haven't tested though :|Correct. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now