tagCANDY CGI VBレスキュー(花ちゃん)の Visual Basic 6.0用 掲示板
VBレスキュー(花ちゃん)の Visual Basic 6.0用 掲示板
[ツリー表示へ]  [ワード検索]  [Home]

タイトル フルスクリーンにした場合のラベル等の位置
投稿日: 2009/07/21(Tue) 11:41
投稿者わいも
VB6.0を使っています。

下記のように、スクリーンの大きさが違うパソコンでも画面サイズを最大化し、
(VBにフラッシュムービーを貼り付けているので)フラッシュムービーも
最大化できるようなプログラムを記述しました。
そしてそのフラッシュムービーの上からラベルや画像を貼り付けました。
作業用のパソコンとは違うパソコンで再生したところ、スクリーンの大きさが違うらしく、
ラベルや画像が設定したところに来ておらず、移動してしまっています。

スクリーンが違うパソコンでも同じ場所にラベルや画像がくるような
プログラムがあればを教えてください。

Private img As Object
Private imgStyle As Object
Private baseWidth As Integer
Private baseHeight As Integer


Private Sub Resize()
    a2.Move 0, 0, ScaleWidth, ScaleHeight
    If img Is Nothing Then
        Exit Sub
    End If
    Dim xZoom As Single, yZoom As Single
    On Error Resume Next
    xZoom = ScaleWidth / baseWidth
    yZoom = ScaleHeight / baseHeight
    If Err.Number <> 0 Then
        xZoom = 1!
        yZoom = 1!
    End If
    On Error GoTo 0
    If xZoom <= 1! Or yZoom <= 1! Then
        imgStyle.Zoom = "100%"
    Else
        imgStyle.Zoom = Format(IIf(xZoom < yZoom, xZoom, yZoom), "0.000%")
    End If
End Sub


Private Sub Form_Resize()
    Resize


End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    Dim doc As Object
    Set doc = pDisp.Document
    Dim body As Object
    Set body = doc.body
    With body.runtimeStyle
        .padding = "0"
        .margin = "0"
        .overflow = "hidden"
        .BorderStyle = "none"
        .BackgroundColor = "ThreeDFace"
    End With
    Set img = doc.getElementsByTagName("IMG")(0)
    baseWidth = img.clientWidth
    baseHeight = img.clientHeight
    Set imgStyle = img.runtimeStyle
    imgStyle.margin = "0"
    Resize
End Sub


Private Sub Form_Load()
    ScaleMode = vbPixels

       a2.Movie = (App.Path & "フラッシュ.swf")
       Call a2.Play
      
End Sub

- 関連一覧ツリー をクリックするとツリー全体を一括表示します)

古いスレッドにレスはつけられません。