Horizontßlnφ a vertikßlnφ zrcadlenφ obrßzku

Postup:
Na formulß° vlo₧te dva PictureBoxy a dv∞ tlaΦφtka
. PotΘ deklarujte:

Const SRCCOPY = &HCC0020 
Const Pi = 3.14159265359 

Private Declare Function SetPixel Lib "GDI32" (ByVal hDC As _ 
Integer, ByVal X As Integer, ByVal Y As Integer, ByVal crColor _ 
As Long) As Long 

Private Declare Function GetPixel Lib "GDI32" (ByVal hDC As _ 
Integer, ByVal X As Integer, ByVal Y As Integer) As Long 

Private Declare Function StretchBlt% Lib "GDI32" (ByVal hDC%, _ 
ByVal X%, ByVal Y%, ByVal nWidth%, ByVal nHeight%, ByVal _ 
hSrcDC%, ByVal XSrc%, ByVal YSrc%, ByVal nSrcWidth%, ByVal _ 
nSrcHeight%, ByVal dwRop&) 

Sub Form_Load () 

   picture1.ScaleMode = 3 
   picture2.ScaleMode = 3 

End Sub 

Sub Command1_Click () 
   'Horizontzßlnφ zrcadlo 

   picture2.Cls 
   px% = picture1.ScaleWidth 
   py% = picture1.ScaleHeight 
   retval% = StretchBlt(picture2.hDC, px%, 0, -px%, py%, _ 
      picture1.hDC, 0, 0, px%, py%, SRCCOPY) 

End Sub 

Sub Command2_Click () 
   
'Vertikßlnφ zrcadlo 

   picture2.Cls 
   px% = picture1.ScaleWidth 
   py% = picture1.ScaleHeight 
   retval% = StretchBlt(picture2.hDC, 0, py%, px%, -py%, _ 
      picture1.hDC, 0, 0, px%, py%, SRCCOPY) 

End Sub

Zp∞t

Autor: The Bozena