views:

18

answers:

0

I have a Shockwave Flash Object in my form. I'm trying to use StretchBlt to magnify the object. Ideally I would like to push a button and have it replace the Flash Object on my form with the magnified version.

Any help would be appreciated, even just documentation on how to use StrechBlt because I can't find anything on it. Thank you.

The code below I find browsing the web. It was originally for a mouse cursor, but I'm trying to adapt it.

    Private Declare Function GetCursorPos Lib "user32" (ByRef lPointCoordinateoint As PointAPI) As Integer
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lplWindowName As String) As Integer
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Integer) As Integer
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal nSrcWidth As Integer, ByVal nSrcHeight As Integer, ByVal dwRop As Integer) As Integer
Private Declare Function GetDesktopWindow Lib "user32" () As Integer
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Integer, ByVal hdc As Integer) As Integer
Private Structure PointAPI
    Dim X As Integer
    Dim Y As Integer
End Structure
Dim PointCoordinate As PointAPI
Dim lWind As Integer
Dim lDesktop As Integer
Dim lButton As Integer

Private Sub Video_Mag_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Video_Mag.Click
    Dim lWind As Object

    lWind = GetDesktopWindow()

    lDesktop = GetDC(lWind)

    lButton = GetDC(Me.Handle.ToInt32)

    Timer.Enabled = True
End Sub

Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer.Tick
    GetCursorPos(PointCoordinate)
    'StretchBlt(lButton, 2, 2, 124, 60, lDesktop, PointCoordinate.X - 30, PointCoordinate.Y - 12.5, 124, 60, &HCC0020)
    StretchBlt(lButton, 0, 0, webFlash.Width, webFlash.Height, lDesktop, Full.Width, Full.Height, 25, 25, &HCC0020)
End Sub