Happy holidays.
Dick
Code: Select all
Dialog>TitleBarSizeCalculation
Top=0
Left=0
Button=1,0,0,75,25,0
EndDialog>TitleBarSizeCalculation
Let>WIN_USEHANDLE=1
GetWindowPos>TitleBarSizeCalculation.msButton1.handle,OffSetX,OffSetY
Let>WIN_USEHANDLE=0
Dialog>Dialog1
object Dialog1: TForm
BorderIcons = [biSystemMenu]
Caption = 'Draw_Me'
end
EndDialog>Dialog1
AddDialogHandler>Dialog1,,OnClose,Quit
Let>OffSetY={%OffSetX%+%OffSetY%+512}
Let>OffsetX={%OffSetX%+%OffSetX%+512}
ResizeWindow>Draw_Me,OffSetX,OffSetY
MoveWindow>Draw_Me,10,0
Show>dialog1
Let>Ystart=-1
Random>254,col
Let>color={(256*256*%col%)-1}
Let>Xpos=-1
Let>Ypos=YStart
Label>Loop
Repeat>Xpos
Add>Xpos,1
GoSub>DrawLine,Dialog1.handle,1,0,Xpos,{%Ypos%+1},Xpos,{%Ystart%+256}
Repeat>Ypos
Add>Ypos,1
Let>Xnext=Xpos+1
Let>Ynext=Ypos+1
Add>color,1
GoSub>DrawLine,Dialog1.handle,1,Color,Xpos,Ypos,Xnext,Ynext
SetDialogProperty>Dialog1,,Caption,Color number = %color% X position = %Xpos% 65536 block = %col%
Until>Ypos={%Ystart%+256}
Let>Ypos=YStart
If>Xpos=255
Random>254,col
Let>color={(256*256*%col%)-1}
EndIf
Until>Xpos=511
Add>Ystart,256
If>Ystart>500
Let>Ystart=-1
EndIf
Let>Ypos=YStart
Let>Xpos=-1
Random>254,col
Let>color={(256*256*%col%)-1}
Goto>Loop
//DrawLine Usage:
//GoSub>DrawLine,WindowHandle,PenSize,PenColor,XStart,YStart,XEnd,YEnd
SRT>DrawLine
LibFunc>user32,GetDC,HDC,%DrawLine_var_1%
LibFunc>gdi32,CreatePen,Penres,0,%DrawLine_var_2%,%DrawLine_var_3%
LibFunc>gdi32,SelectObject,SOPres,hdc,Penres
Libfunc>gdi32,MoveToEx,mtres,HDC,%DrawLine_var_4%,%DrawLine_var_5%,0
LibFunc>gdi32,LineTo,ltres,hdc,%DrawLine_var_6%,%DrawLine_var_7%
LibFunc>gdi32,DeleteObject,DOres,Penres
LibFunc>user32,ReleaseDC,RDCres,HDC_1,HDC
END>DrawLine
SRT>Quit
Exit>0
END>Quit