Home > Archive > Visual Basic > August 2005 > Shockwave/Flash question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Shockwave/Flash question
|
|
|
| Hi,
I'm not sure this is the right group, but I need to have an answer. I build
an aplication, using two screens, e.g. a control screen (form) on the main
monitor and a second screen (borderless form) on the secondary monitor. This
is a program to display text and graphic by using a beamer.
Text and pictures and text on pictures work OK. The next step is to show a
flash animation on the beamerscreen. Well that also works, but when I start
the program, and then (by a button click) start the Flash animation (the
beamer windowscreen is not displaying, yet), nothing happens (it looks that
way) but according to the progrtam it's ok. Then I press the button to
'open' the beamerscreen. The beamer shows the screenwindow with the standard
background (Picturebox behind textlabels) What happens is that the flash
animation is shown. (I dis put the Flas control inside the picturebox) I can
stop it and restart it. But, when I first open the beamerscreen window and
next I press the button to start the Flash animation the animation is not
shown on the beamerscreen. Why is it not working the way I want?
Second: can anybody explain me how the Flash.ocx control works? I know the
use of the properties and methods: Top, Left, Height, Wigth, Loop, Playing
(trye or false), Movie etc. But when the animation flash movie is running,
how do I stop it? I tried Stop and StopPlaying, but that did not work. Using
the Playing=true and False seems to do the trick. The Loadmovie seems to do
the same as Movie.
Third: how can I put text (in textlabels) on the form as an 'overlay' on the
movie? E.g. I want to show text (textlabels) on the beamerscreen while a
flash movie is running behind the text. How do I do that?
I would appreciate any help. When I'm not clear in my question, please ask
for more info.
Best regards,
Jacob
| |
| Juergen Thuemmler 2005-08-27, 3:55 am |
| > Second: can anybody explain me how the Flash.ocx control works? I know the
> use of the properties and methods: Top, Left, Height, Wigth, Loop, Playing
> (trye or false), Movie etc. But when the animation flash movie is running,
> how do I stop it? I tried Stop and StopPlaying, but that did not work.
> Using the Playing=true and False seems to do the trick. The Loadmovie
> seems to do the same as Movie.
I'm using
With SWF
.GotoFrame 0
.StopPlay
.Visible = False
End With
> Third: how can I put text (in textlabels) on the form as an 'overlay' on
> the movie? E.g. I want to show text (textlabels) on the beamerscreen while
> a flash movie is running behind the text. How do I do that?
AFAIK, you cannot create a real overlay using VB only. I'm using:
Private Declare Function BeginPath& Lib "gdi32" (ByVal hdc&)
Private Declare Function EndPath& Lib "gdi32" (ByVal hdc&)
Private Declare Function PathToRegion& Lib "gdi32" (ByVal hdc&)
Private Declare Function TextOut& Lib "gdi32" Alias "TextOutA" (ByVal hdc&,
ByVal x&, ByVal y&, ByVal lpString As String, ByVal nCount&)
Private Declare Function SetWindowRgn& Lib "user32" (ByVal hwnd&, ByVal
hRgn&, ByVal bRedraw As Boolean)
Dim hRgn&, tw&, th&
Sub SetText(myText$)
With Me
tw = .TextWidth(myText) + 2 * Screen.TwipsPerPixelx
th = .TextHeight(myText) + 2 * Screen.TwipsPerPixely
.Width = tw: .Height = th
BeginPath .hdc
TextOut .hdc, 1, 1, myText, Len(myText)
EndPath .hdc
hRgn = PathToRegion(.hdc)
SetWindowRgn .hwnd, hRgn, True
End With
End Sub
to make a "punched" text from a separate form (set it topmost), but there
are some limitations:
- you can do it only with TrueType fonts, and
- because of the use of SetWindowRgn(), you'll get pixeled edges (no font
smoothing), so this method should be used for large font sizes (14 Pt and
greater) only.
Juergen.
|
|
|
|
|