Started by Paul Squires, March 17, 2023, 09:31:22 AM
pCanvas->WriteText( 1.5, 3.5, "Phone: (000) 000-0000", colors.Black, colors.White )pCanvas->WriteTextBox( 12.5, 3.5, 16.6, 4.2, "INVOICE #", hPen, colors.LightSlateGray, DT_TOP or DT_RIGHT, colors.Black, colors.White )
' Draw a box (rectangle) using the passed Pen.function CPrintPreview.DrawRect( _ byval nLeft as single, _ byval nTop as single, _ byval nRight as single, _ byval nBottom as single, _ byval hPen as HPEN _ ) as long return DrawRectInternal( nLeft, nTop, nRight, nBottom, hPen, -1 ) ' <- this last value sets the fill colour to Black.end function
byval clrFill as COLORREF '' changed -1 to clrFill allowing the fill colour to be customized.
Quote from: James Klutho on March 17, 2023, 04:59:57 PMI love the simplicity of your code. Very nicely done. A note, I couldn't get the preview "zoom" to work though the demo printed just fine. Also, will you support vertical or angled fonts?
Quote from: SeaVipe on March 17, 2023, 07:23:45 PMI'm sure I've overlooked something obvious, but the above works.
Quote from: James Klutho on March 17, 2023, 04:59:57 PMI love the simplicity of your code. Very nicely done.