Results 1 to 15 of 15

Thread: Broadcast video from projector !!!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    104

    Broadcast video from projector !!!

    Hi dears

    I have a project contain many video players, how can I broadcast only one video (one stream)? I want ability to change (send for output) videos only on my PC at runtime, without appearing controls on Projector (DataShow).
    Something like tv studio control room.

    Name:  Output stream.jpg
Views: 406
Size:  23.9 KB

    Sincerely
    Mahmood Kh Pirani

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: Broadcast video from projector !!!

    Not certain what you are desiring, here. BUT, if it is simply showing one of your video streams onto a connected projector, create a separate form and put that video control on it as well. Then, when you want to present it on the projector, use the projector as a second monitor. (Extend your computer display, leaving your main form on your computer screen, and placing the second form on the second screen (which is your monitor)). You can then see it in both places. I don't do video streams, but I use an 'audience form' all the time. There is simple code to place in a button/menu to move that second form to the second screen and even maximize it.

    Is that what you are looking for?

    Sam

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    104

    Re: Broadcast video from projector !!!

    I know but I want to make changes during presenting, and round between videos when I want, and I don't want anyone to see when I work on my form controls.

  4. #4
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Broadcast video from projector !!!

    Well since a projector does not broadcast anything other than light I really have no clue what the question really is here.

  5. #5
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: Broadcast video from projector !!!

    Then, like I said, put a form on your second screen (your projector), only what you want your audience to see. Leave everything else on your computer monitor. You can set it up to show one, or multiple forms on a second screen---easy to do. Just on that form (those forms) show only the video you want them to see.

    Do you understand how to set up a projector as a second screen?

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    104

    Re: Broadcast video from projector !!!

    Quote Originally Posted by DataMiser View Post
    Well since a projector does not broadcast anything other than light I really have no clue what the question really is here.
    when I connect my PC to a projector, everyone can see what do I do on PC, I want a form to work on and second form for presenting, that is when I am working (changing stream 2,3, or 4), at that time others are looking stream 1 on second form. ( Separating working form with presenting form). I hope to you understand me. sorry for my bad english language!

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    104

    Re: Broadcast video from projector !!!

    Quote Originally Posted by SamOscarBrown View Post
    Then, like I said, put a form on your second screen (your projector), only what you want your audience to see. Leave everything else on your computer monitor. You can set it up to show one, or multiple forms on a second screen---easy to do. Just on that form (those forms) show only the video you want them to see.

    Do you understand how to set up a projector as a second screen?
    Do you mean extending projector? If you mean (Extend) everyone can see what I am doing on my PC. ( I mean separating forms, working and changing stream ,2,3,and 4, while others only looking (only stream 1 is presenting) stream 1. working form hidden for others.

  8. #8
    Hyperactive Member
    Join Date
    Mar 2017
    Posts
    500

    Re: Broadcast video from projector !!!

    I'm totally lost.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    104

    Re: Broadcast video from projector !!!

    Quote Originally Posted by Ordinary Guy View Post
    I'm totally lost.
    why? make working form hidden from bystander (viewers), and making a second form visible for bystanders.
    working on first form while views looking second form!
    Is it clear now?

  10. #10
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Broadcast video from projector !!!

    Well like Sam said extend your display to the projector as the second display.
    Your main form would be on the main display which would be your PC monitor or laptop
    The second display would be the projector, you drag your second form over to that display so the projector shows that form and your monitor shows the main form.

    Assuming of course your video card supports dual displays

  11. #11
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: Broadcast video from projector !!!

    To prevent you from having to drag the form to the second screen (your projector) when you have Extended your screen, put this code in a module first:

    Code:
    Option Explicit
    '
    Dim glSpecifiedMonitor As Long
    Dim glWindowToCheckOnMonitor As Long
    Dim glMonitorWidth As Long
    Dim glMonitorHeight As Long
    Dim gbMonitorIsPrimary As Boolean
    Dim gbWindowIsOnMonitor As Boolean
    Dim glSecondaryMonitorNumber As Long
    '
    Private Type RECT
      Left As Long
      Top As Long
      Right As Long ' This is +1 (right - left = width)
      Bottom As Long ' This is +1 (bottom - top = height)
    End Type
    Public Type MONITORINFO
        cbSize As Long
        rcMonitor As RECT
        rcWork As RECT
        dwFlags As Long
    End Type
    Private Const MONITORINFOF_PRIMARY = &H1
    Private Const MONITOR_DEFAULTTONEAREST = &H2
    Private Const MONITOR_DEFAULTTONULL = &H0
    Private Const MONITOR_DEFAULTTOPRIMARY = &H1
    '
    Private Declare Function MonitorFromWindow Lib "user32.dll" (ByVal hWnd As Long, ByVal dwFlags As Long) As Long
    Private Declare Function GetMonitorInfo Lib "user32.dll" Alias "GetMonitorInfoA" (ByVal hMonitor As Long, ByRef lpmi As MONITORINFO) As Long
    Private Declare Function EnumDisplayMonitors Lib "user32" (ByVal hdc As Long, lprcClip As Any, ByVal lpfnEnum As Long, dwData As Long) As Long
    Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
    Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
    Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hdc As Long) As Long
    Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
    '
    Public Sub CenterFormOnMonitorTwo(frm As Form) ' This is actually just the non-primary monitor.
        ' This assumes that the second monitor is to the right of the first.
        ' Other work will be needed if this isn't the case.
        Dim MonitorTwoHeight As Long
        Dim MonitorTwoWidth As Long
        Dim iSecondaryMonitorNumber As Long
        '
        If MonitorCount = 1 Then Exit Sub
        iSecondaryMonitorNumber = SecondaryMonitorNumber
        '
        MonitorTwoWidth = MonitorPixelWidth(iSecondaryMonitorNumber) * Screen.TwipsPerPixelX
        MonitorTwoHeight = MonitorPixelHeight(iSecondaryMonitorNumber) * Screen.TwipsPerPixelY
            ''
            If frm.WindowState <> vbMaximized Then
            frm.Left = ((MonitorTwoWidth - frm.Width) \ 2) + Screen.Width
            frm.Top = (MonitorTwoHeight - frm.Height) \ 3
            If Not WindowIsOnMonitor(iSecondaryMonitorNumber, frm.hWnd) Then
                ' Primary must be on right if not visible.
                frm.Left = ((MonitorTwoWidth - frm.Width) \ 2) - Screen.Width
                frm.Top = (MonitorTwoHeight - frm.Height) \ 3
            End If
            If Not WindowIsOnMonitor(iSecondaryMonitorNumber, frm.hWnd) Then
                ' Couldn't do it for some reason, so forget it.
                ' Maybe monitors are on top of one another.
                frm.Left = (ScreenWidth - frm.Width) \ 2
                frm.Top = (ScreenHeight - frm.Height) \ 3
            End If
        End If
    End Sub
    Public Function SecondaryMonitorNumber() As Long
        Dim iCount As Long
        '
        glSecondaryMonitorNumber = 0
        glSpecifiedMonitor = -1 ' Don't specify one to just execute.
        EnumDisplayMonitors 0, ByVal 0&, AddressOf MonitorEnumProc, iCount
        SecondaryMonitorNumber = glSecondaryMonitorNumber
    End Function
    Public Function WindowIsOnMonitor(iMonitor As Long, hWnd As Long) As Boolean
        Dim iCount As Long
        '
        gbWindowIsOnMonitor = False
        glSpecifiedMonitor = iMonitor
        glWindowToCheckOnMonitor = hWnd
        EnumDisplayMonitors 0, ByVal 0&, AddressOf MonitorEnumProc, iCount
        WindowIsOnMonitor = gbWindowIsOnMonitor
    End Function
    Public Function MonitorCount() As Long
        Dim iCount As Long
        '
        glSpecifiedMonitor = -1 ' Don't specify one to just count.
        EnumDisplayMonitors 0, ByVal 0&, AddressOf MonitorEnumProc, iCount
        MonitorCount = iCount
    End Function
    Private Function MonitorEnumProc(ByVal hMonitor As Long, ByVal hDCMonitor As Long, uRect As RECT, dwData As Long) As Long
        Dim MI As MONITORINFO
        ' This is just used for the above functions.
        dwData = dwData + 1 ' Increase monitor count.
        If glSpecifiedMonitor = dwData Then SetMonitorGlobals hMonitor, uRect
        ' We must still set the glSecondaryMonitorNumber.
        MI.cbSize = Len(MI)
        GetMonitorInfo hMonitor, MI
        If Not CBool(MI.dwFlags = MONITORINFOF_PRIMARY) Then ' This is the "primary monitor test".
            glSecondaryMonitorNumber = dwData
        End If
        '
        MonitorEnumProc = 1
    End Function
    Public Function MonitorPixelWidth(iMonitor As Long) As Long
        ' Returns the width of the specified monitor.
        ' Handles systems with multiple monitors.
        Dim iCount As Long
        '
        glSpecifiedMonitor = iMonitor
        EnumDisplayMonitors 0, ByVal 0&, AddressOf MonitorEnumProc, iCount
        MonitorPixelWidth = glMonitorWidth
    End Function
    Public Function MonitorPixelHeight(iMonitor As Long) As Long
        ' Returns the height of the specified monitor.
        ' Handles systems with multiple monitors.
        Dim iCount As Long
        '
        glSpecifiedMonitor = iMonitor
        EnumDisplayMonitors 0, ByVal 0&, AddressOf MonitorEnumProc, iCount
        MonitorPixelHeight = glMonitorHeight
    End Function
    Public Function ScreenWidth()
        ' This works even on Tablet PC.  The problem is: when the tablet screen is rotated, the "Screen" object of VB doesn't pick it up.
        Dim Pixels As Long
        Const SM_CXSCREEN = 0
        '
        Pixels = GetSystemMetrics(SM_CXSCREEN)
        ScreenWidth = Pixels * TwipsPerPixelX
    End Function
    Public Function ScreenHeight(Optional bSubtractTaskbar As Boolean = False)
        ' This works even on Tablet PC.  The problem is: when the tablet screen is rotated, the "Screen" object of VB doesn't pick it up.
        Dim Pixels As Long
        Const SM_CYSCREEN = 1
        '
        Pixels = GetSystemMetrics(SM_CYSCREEN)
        If bSubtractTaskbar Then
            ' The taskbar is typically 30 pixels or 450 twips, or, at least, this is the assumption made here.
            ' It can actually be multiples of this, or possibly moved to the side or top.
            ' This procedure does not account for these possibilities.
            ScreenHeight = (Pixels - 30) * TwipsPerPixelY
        Else
            ScreenHeight = Pixels * TwipsPerPixelY
        End If
    End Function
    Private Sub SetMonitorGlobals(hMonitor As Long, uRect As RECT)
        Dim MI As MONITORINFO
        '
        glMonitorWidth = uRect.Right - uRect.Left
        glMonitorHeight = uRect.Bottom - uRect.Top
        MI.cbSize = Len(MI)
        GetMonitorInfo hMonitor, MI
        gbMonitorIsPrimary = CBool(MI.dwFlags = MONITORINFOF_PRIMARY)
        gbWindowIsOnMonitor = (MonitorFromWindow(glWindowToCheckOnMonitor, MONITOR_DEFAULTTONEAREST) = hMonitor)
    End Sub
    Public Function TwipsPerPixelX() As Single
        ' This works even on Tablet PC.  The problem is: when the tablet screen is rotated, the "Screen" object of VB doesn't pick it up.
        Dim hdc As Long
        Dim lPixelsPerInch As Long
        Const LOGPIXELSX = 88        '  Logical pixels/inch in X
        Const POINTS_PER_INCH As Long = 72 ' A point is defined as 1/72 inches.
        Const TWIPS_PER_POINT As Long = 20 ' Also, by definition.
        '
        hdc = GetDC(0)
        lPixelsPerInch = GetDeviceCaps(hdc, LOGPIXELSX)
        ReleaseDC 0, hdc
        TwipsPerPixelX = TWIPS_PER_POINT * (POINTS_PER_INCH / lPixelsPerInch) ' Cancel units to see it.
    End Function
    Public Function TwipsPerPixelY() As Single
        ' This works even on Tablet PC.  The problem is: when the tablet screen is rotated, the "Screen" object of VB doesn't pick it up.
        Dim hdc As Long
        Dim lPixelsPerInch As Long
        Const LOGPIXELSY = 90        '  Logical pixels/inch in Y
        Const POINTS_PER_INCH As Long = 72 ' A point is defined as 1/72 inches.
        Const TWIPS_PER_POINT As Long = 20 ' Also, by definition.
        '
        hdc = GetDC(0)
        lPixelsPerInch = GetDeviceCaps(hdc, LOGPIXELSY)
        ReleaseDC 0, hdc
        TwipsPerPixelY = TWIPS_PER_POINT * (POINTS_PER_INCH / lPixelsPerInch) ' Cancel units to see it.
    End Function
    Then, in a menu option, or a CMD button click event, do this:

    Code:
        theNameOfYourSecondFormYouWantTheAudienceToSee.Show
        CenterFormOnMonitorTwo theNameOfYourSecondFormYouWantTheAudienceToSee
        theNameOfYourSecondFormYouWantTheAudienceToSee.WindowState = vbMaximized
    The last line is for maximizing that 2nd form on that projector (This is not necessary if you don't want it maximized).

    Sam

  12. #12
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: Broadcast video from projector !!!

    Here is a simple example...just make sure your Screen is set to EXTEND to Second Monitor.

    First, click one of the buttons to display one of the images you see on your screen onto the 2nd screen. Then while you are changing the image in the top left, the audience doesn't see you do this. Then, click that first car button again to now show the NEW car on the audience screen.

  13. #13
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: Broadcast video from projector !!!

    Here is a simple example...just make sure your Screen is set to EXTEND to Second Monitor.

    First, click one of the buttons to display one of the images you see on your screen onto the 2nd screen. Then while you are changing the image in the top left, the audience doesn't see you do this. Then, click that first car button again to now show the NEW car on the audience screen.

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    104

    Re: Broadcast video from projector !!!

    Many Thanks to you all friends!

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    104

    Re: Broadcast video from projector !!!

    Quote Originally Posted by SamOscarBrown View Post
    Here is a simple example...just make sure your Screen is set to EXTEND to Second Monitor.

    First, click one of the buttons to display one of the images you see on your screen onto the 2nd screen. Then while you are changing the image in the top left, the audience doesn't see you do this. Then, click that first car button again to now show the NEW car on the audience screen.
    Many thanks dear #SamOscarBrown

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width