Announcement

Collapse
No announcement yet.

Dialogs and Graphic Windows

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dialogs and Graphic Windows

    Is there anyway to put a graphic window onto a dialog? I have a need to show both an original video feed on a window with buttons and the associated callbacks, but also want to show the video with alterations on the same window separate from the source video. Right now I can do this with two separate windows, but this is very suboptimal.

    So the question is whether it is possible to get the capabilities of a graphic window (e.g. - trapping mouse events and coordinates and then drawing lines on the video) on a dialog. It does not seem that dialogs can contain graphic windows or vice versa.

    Any ideas?

    Muchos Gracias...

    Kevin

  • #2
    A Graphic Window is intended to be a "standalone" window. On a Dialog, just use a Graphic Control (CONTROL ADD GRAPHIC). They are functionally identical.

    Bob Zale
    PowerBASIC Inc.

    Comment


    • #3
      Perfect...thanks Bob.

      Comment


      • #4
        Hi Bob,

        When I try this:


        DIALOG NEW PIXELS, 0, "Cramer Surveillance Inc", ,, 680, 400, _
        %DS_MODALFRAME OR %WS_CAPTION OR %WS_SYSMENU OR %WS_EX_WINDOWEDGE OR %DS_SYSMODAL, 0 TO hdlg
        DIALOG SET COLOR hDlg, -1, RGB(245,245,220)

        CONTROL ADD GRAPHIC, hDlg,hWin,"",10, 5, imWidth, imHeight
        GRAPHIC ATTACH hWin, hDlg, REDRAW


        Then do some pixel setting like this:

        FOR y = 1 TO imWidth
        FOR x = 1 TO imHeight
        rgbColor& = RGB(img2(y, imHeight+1-x).rgbtred,img2(y, imHeight+1-x).rgbtgreen,img2(y, imHeight+1-x).rgbtblue)
        'rgbColor& = RGB(img(y, x).rgbtred,img(y, x).rgbtgreen,img(y, x).rgbtblue)

        GRAPHIC SET PIXEL (y, x) , rgbColor&

        NEXT y
        NEXT x

        GRAPHIC REDRAW

        The graphic window is there where I want it, but is blank. It seems that the redraw does not happen...

        Comment


        • #5
          I see that I had the handles reversed...now it works...

          Comment

          Working...
          X