What would the view be like peering out the front porthole?
Press Esc to abort the trip.
Code: Select all
OnEvent>key_down,VK27,0,Quit
Dialog>Dialog1
object Dialog1: TForm
AlphaBlend = True
AlphaBlendValue = 1
Caption = 'Base'
ClientHeight = 800
ClientWidth = 800
Color = 3
object MSImage1: tMSImage
Left = 0
Top = 0
Width = 800
Height = 800
end
end
end
EndDialog>Dialog1
Dialog>Dialog2
object Dialog2: TForm
Position = poScreenCenter
BorderStyle = bsNone
Caption = 'Mirror'
ClientHeight = 800
ClientWidth = 800
Color = 3
OnTaskBar = True
end
EndDialog>Dialog2
AddDialogHandler>Dialog1,,OnClose,Quit
LibFunc>user32,GetDC,HDC1,%Dialog1.handle%
LibFunc>user32,GetDC,HDC2,%Dialog2.handle%
LibFunc>Gdi32,SetStretchBltMode,SSBMres,HDC2,4
LibFunc>Gdi32,SetBrushOrgEx,SBOEres,HDC2,30,30,
SetDialogProperty>Dialog1,,AlphaBlendValue,0
Show>Dialog1
Show>Dialog2
CloseDialog>Dialog2
Let>WIN_USEHANDLE=1
GetWindowPos>dialog2.handle,WinX,WinY
Let>WIN_USEHANDLE=0
Let>LRX=%WinX%+800
Let>LRY=%WinY%+800
ScreenCapture>WinX,WinY,LRX,LRY,%temp_dir%BaseToMirror.jpg
Show>Dialog2
GoSub>Reflect
Random>8,Xlocation
Add>Xlocation,390
Let>Ylocation={%XLocation%+(%XLocation%-393)}
Random>16777215,color
GoSub>DrawArc,Dialog1.Handle,1,color,398,398,401,401,398,398,398,398
Let>kk=0
Label>Loop
Add>kk,1
If>kk=4
Let>kk=0
Random>8,Xlocation
Add>Xlocation,390
Let>Ylocation=%XLocation%+19
Random>16777215,color
EndIf
Let>WIN_USEHANDLE=1
GetWindowPos>dialog2.handle,WinX,WinY
Let>WIN_USEHANDLE=0
Let>LRX=%WinX%+800
Let>LRY=%WinY%+800
ScreenCapture>WinX,WinY,LRX,LRY,%temp_dir%BaseToMirror.jpg
SetDialogProperty>Dialog1,MSimage1,LoadImage,%temp_dir%BaseToMirror.jpg
GoSub>DrawArc,Dialog1.Handle,1,color,398,398,401,401,398,398,398,398
GoSub>Reflect
//Wait>0.01
Goto>Loop
////////////////// Start Projection Sub //////////////////
SRT>Reflect
LibFunc>Gdi32,StretchBlt,SBres,HDC2,-40,-40,880,880,HDC1,0,0,800,800,13369376
END>Reflect
////////////////// End Projection Sub //////////////////
//DrawArc Usage:
//GoSub>DrawArc,WindowHandle,PenSize,PenColor,ULXLoc,ULYLoc,LRXLoc,LRYLoc,SXLoc,SYLoc,EXLoc,EYLoc
SRT>DrawArc
LibFunc>user32,GetDC,HDC,%DrawArc_var_1%
LibFunc>gdi32,CreatePen,Penres,0,%DrawArc_var_2%,%DrawArc_var_3%
LibFunc>gdi32,SelectObject,SOPres,hdc,Penres
Libfunc>gdi32,Arc,ARCres,HDC,%DrawArc_var_4%,%DrawArc_var_5%,%DrawArc_var_6%,%DrawArc_var_7%,%DrawArc_var_8%,%DrawArc_var_9%,%DrawArc_var_10%,%DrawArc_var_11%
LibFunc>gdi32,DeleteObject,DOres,Penres
LibFunc>user32,ReleaseDC,RDCres,HDC_1,HDC
END>DrawArc
////////////////// End JRL's Draw Function Subs //////////////////
SRT>Quit
LibFunc>user32,ReleaseDC,RDCres1,HDC1_1,HDC1
LibFunc>user32,ReleaseDC,RDCres1,HDC2_1,HDC2
LibFunc>GDI32,DeleteObject,DOres,LIres
DeleteFile>%temp_dir%BaseToMirror.jpg
Exit>0
END>Quit