Post by tenochtitlanuk on May 2, 2020 5:49:08 GMT -5
I didn't really understand scaling and rotating fonts, so wrote a test program to try the parameters over various ranges. Learned it rotates around bounding box bottom lefthand corner was one useful outcome.
A serendipitous outcome was this graphic! Uses cycling colours and rotates/scales the character '!' each time.
Cheered ME at least up- at present locked down at home for Corvid isolation, with modem down ( so VERY slow access to web via mobile phone data in a one-bar-if-you-are-lucky house in a blackspot phone area), and with a plumbing fault that has meant we've had no hot water from taps for three months! At least the Spring garden and countriside are beautiful...
nomainwin
global angle
WindowWidth =600
WindowHeight =600
open "test" for graphics_nsb as #mg
#mg "trapclose [quit]"
hw = hwnd( #mg)
calldll #user32, "GetDC", hw as ulong, hdc as ulong
calldll #gdi32, "SetBkMode", hdc as long, 1 As long, result As long
#mg "home ; fill darkblue ; color cyan ; backcolor darkblue"
#mg "fill darkblue ; color cyan ; backcolor darkblue"
weight = 0 ' how much to emphasize /widen the strokes
height =470 ' how big to make font ?in pixels?
for angle =0 to -10800 step -50' 3 revolutions- rotates about bottom left-hand od character bounding box
height =height -2 ' progressively reduce font size
calldll #gdi32, "CreateFontA",_
height as long, 0 as long,_
angle as long, angle as long,_
weight as long,_
0 as long, 0 as long, 0 as long, 0 as long, 0 as long, 0 as long, 0 as long, 0 as long,_
"Arial" as ptr,_
hfont as ulong
calldll #gdi32, "SelectObject", hdc as ulong, hfont as ulong, oldhfont as ulong
#mg "color "; col$()
#mg "place "; 300 +230 *sinR( t +deg); " "; 300 -230 *cosR( t +deg)
#mg "\!"
#mg "getbmp scr 0 0 600 600"
'bmpsave "scr", "images3/scr" +str$( time$( "ms")) +".bmp"
timer 100, [p]
wait
[p]
timer 0
next angle
wait
function col$() ' graduated colour cycling
red =int( 128 +127 *sin( angle /607))
grn =int( 128 +127 *cos( angle /845))
blu =int( 128 +127 *cos( angle /423))
col$ =str$( red) +" " +str$( grn) +" " +str$( blu)
end function
[quit]
calldll #user32, "ReleaseDC", hWnd as long, hdc as long, result as long
close #mg
end