home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / leadtools / ocx32.lt / Fullscrn.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-06-17  |  12.9 KB  |  329 lines

  1. VERSION 5.00
  2. Object = "{00100003-B1BA-11CE-ABC6-F5B2E79D9E3F}#1.0#0"; "ltocx10n.ocx"
  3. Begin VB.Form FullScreenFrm 
  4.    BackColor       =   &H00000000&
  5.    BorderStyle     =   0  'None
  6.    ClientHeight    =   4065
  7.    ClientLeft      =   2550
  8.    ClientTop       =   2535
  9.    ClientWidth     =   4380
  10.    ControlBox      =   0   'False
  11.    KeyPreview      =   -1  'True
  12.    LinkTopic       =   "Form2"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    PaletteMode     =   1  'UseZOrder
  16.    ScaleHeight     =   4065
  17.    ScaleWidth      =   4380
  18.    ShowInTaskbar   =   0   'False
  19.    Begin VB.Timer Timer1 
  20.       Enabled         =   0   'False
  21.       Left            =   480
  22.       Top             =   2160
  23.    End
  24.    Begin LEADLib.LEAD Lead1 
  25.       Height          =   1815
  26.       Left            =   240
  27.       TabIndex        =   0
  28.       Top             =   240
  29.       Width           =   2295
  30.       _Version        =   65536
  31.       _ExtentX        =   4048
  32.       _ExtentY        =   3201
  33.       _StockProps     =   229
  34.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  35.          Name            =   "MS Sans Serif"
  36.          Size            =   8.25
  37.          Charset         =   0
  38.          Weight          =   400
  39.          Underline       =   0   'False
  40.          Italic          =   0   'False
  41.          Strikethrough   =   0   'False
  42.       EndProperty
  43.       ScaleHeight     =   121
  44.       ScaleWidth      =   153
  45.       DataField       =   ""
  46.       BitmapDataPath  =   ""
  47.       AnnDataPath     =   ""
  48.       PanWinTitle     =   "PanWindow"
  49.       CLeadCtrl       =   0
  50.    End
  51. Attribute VB_Name = "FullScreenFrm"
  52. Attribute VB_GlobalNameSpace = False
  53. Attribute VB_Creatable = False
  54. Attribute VB_PredeclaredId = True
  55. Attribute VB_Exposed = False
  56. Option Explicit
  57. Dim gMultiPass As Boolean
  58. Dim gQuit As Boolean
  59. Dim gFirstText As Boolean
  60. Dim gFirstShape As Boolean
  61. Dim gDelay As Long
  62. Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
  63. Private Sub ShowImage()
  64.     Dim nRet As Long
  65.     Lead1.AutoRepaint = False
  66.     'load the next image from the list
  67.     If Form1.ImageNameList.ListIndex = Form1.ImageNameList.ListCount - 1 Then
  68.         Form1.ImageNameList.ListIndex = 0
  69.     Else
  70.         Form1.ImageNameList.ListIndex = Form1.ImageNameList.ListIndex + 1
  71.     End If
  72.     Lead1.EnableProgressEvent = False
  73.     nRet = Lead1.Load(Form1.ImageNameList.List(Form1.ImageNameList.ListIndex), 0, 0, 1)
  74.     Lead1.EnableProgressEvent = True
  75.     gQuit = False
  76.     'is a transition set?
  77.     If Form1.gnTransEffect = EFX_EFFECT_NONE Then
  78.         Lead1.TransitionStyle = EFX_TRANSITION_NONE
  79.         Lead1.TransitionEffect = EFX_EFFECT_NONE
  80.     Else
  81.         'set the paint effect for the transition
  82.         Lead1.TransitionEffect = Form1.gnTransEffect
  83.         Lead1.PaintMaxPasses = 1
  84.         Lead1.PaintPass = 1
  85.         
  86.         'set the effect delay for the transition
  87.         Lead1.EffectDelay = Form1.gnTransDelay
  88.         'set the grain size for the transition
  89.         Lead1.EffectGrain = Form1.gnTransGrain
  90.         'set the wand size for the transition
  91.         Lead1.WandSize = Form1.gnTransWandWidth
  92.         'set the wand color for the transition
  93.         Lead1.WandColor = Form1.gclrTransWandColor
  94.         'Transparency for the transition
  95.         Lead1.UseTransparentColor = Form1.gbTransTransparent
  96.         Lead1.TransparentColor = Form1.gclrTransTransparentColor
  97.         'set the transition style, Pattern or Gradient
  98.         If (Form1.gnTransition < EFX_GRADIENT_LINE_CLASS) Then
  99.             Lead1.TransitionStyle = EFX_TRANSITION_PATTERN
  100.         Else
  101.             Lead1.TransitionStyle = EFX_TRANSITION_GRADIENT
  102.         End If
  103.         If Lead1.TransitionStyle = EFX_TRANSITION_PATTERN Then  'pattern transition
  104.             Lead1.PatternStyle = Form1.gnPattern
  105.         Else                                                    'gradient transition
  106.             Lead1.GradientStyle = Form1.gnGradient
  107.             Lead1.PatternStyle = EFX_PATTERN_TRANSPARENT
  108.         End If
  109.         'set the colors
  110.         Lead1.PatternForeColor = Form1.LEADDlg1.ForeColor
  111.         Lead1.PatternBackColor = Form1.LEADDlg1.BackColor
  112.         Lead1.GradientStartColor = Form1.LEADDlg1.StartColor
  113.         Lead1.GradientEndColor = Form1.LEADDlg1.EndColor
  114.     End If
  115.         
  116.     'set the gradient steps for the transition if one
  117.     Lead1.GradientSteps = Form1.LEADDlg1.GradientSteps
  118.     'set the effect for the main bitmap
  119.     Lead1.PaintEffect = Form1.gnMainEffect
  120.     'the effect delay for the main bitmap is set in
  121.     'the PaintNotification event
  122.     'the effect grain size for the main bitmap is set in
  123.     'the PaintNotification event
  124.     'the wand size for the main bitmap is set in
  125.     'the PaintNotification event
  126.     'transparency for the main bitmap is set in
  127.     'the PaintNotification event
  128.     'is a label enabled?
  129.     If (Form1.EfxLabelOption(0).Value = True) Or (Form1.EfxLabelOption(1).Value = True) Then      'no label
  130.         'paint the image
  131.         If (Form1.EfxLabelOption(1).Value = True) Then
  132.             Lead1.PaintMaxPasses = Form1.EfxMaxPass.ListIndex + 2
  133.             Lead1.PaintEffect = Form1.GetMultiEffect(0)
  134.             Lead1.PaintPass = 1
  135.             gMultiPass = True
  136.             Lead1.AutoRepaint = True
  137.         Else
  138.             Lead1.PaintMaxPasses = 1
  139.             Lead1.PaintPass = 1
  140.             Lead1.AutoRepaint = True
  141.         End If
  142.     ElseIf (Form1.EfxLabelOption(2).Value = True) Then  'text label
  143.         'setup the text
  144.         Lead1.DrawFontColor = Form1.LEADDlg1.TextColor
  145.         
  146.         'text location
  147.         Lead1.TextTop = Lead1.ScaleHeight * 0.1
  148.         Lead1.TextLeft = Lead1.ScaleWidth * 0.1
  149.         Lead1.TextWidth = Lead1.ScaleWidth * 0.8
  150.         Lead1.TextHeight = Lead1.ScaleHeight * 0.8
  151.         'text alignment and angle
  152.         Lead1.TextAlign = Form1.LEADDlg1.TextAlign
  153.         Lead1.TextAngle = Form1.LEADDlg1.Angle
  154.         'text hilite color and style
  155.         Lead1.TextHiliteColor = Form1.LEADDlg1.TextHiliteColor
  156.         Lead1.TextStyle = Form1.LEADDlg1.TextStyle
  157.         'text dropshadow
  158.         Lead1.ShadowColor = Form1.LEADDlg1.ShadowColor
  159.         Lead1.ShadowXDepth = Form1.LEADDlg1.ShadowXDepth
  160.         Lead1.ShadowYDepth = Form1.LEADDlg1.ShadowYDepth
  161.         'paint the image
  162.         Lead1.PaintEffect = Form1.gnMainEffect
  163.         Lead1.PaintPass = 1
  164.         Lead1.PaintMaxPasses = 1
  165.         
  166.         Lead1.AutoRepaint = True
  167.         
  168.         'draw the text
  169.         If (Form1.LEADDlg1.TextUseForegroundImage = True) Then
  170.             'setup the image for the foreground of the text
  171.             Form1.Lead2.Bitmap = Form1.LEADDlg1.TextForegroundBitmap
  172.             Lead1.DrawText Form1.LEADDlg1.SampleText, Form1.Lead2.Bitmap
  173.         Else
  174.             Lead1.DrawText Form1.LEADDlg1.SampleText, 0
  175.         End If
  176.     Else                                'shape label
  177.         Lead1.ShadowColor = Form1.LEADDlg1.ShadowColor
  178.         Lead1.ShadowXDepth = Form1.LEADDlg1.ShadowXDepth
  179.         Lead1.ShadowYDepth = Form1.LEADDlg1.ShadowYDepth
  180.         
  181.         'setup the shape
  182.         Lead1.ShapeBackgroundStyle = Form1.LEADDlg1.ShapeBackStyle
  183.         Lead1.PatternStyle = Form1.LEADDlg1.ShapeFillStyle
  184.         
  185.         'set the colors
  186.         Lead1.PatternForeColor = Form1.LEADDlg1.ForeColor
  187.         Lead1.PatternBackColor = Form1.LEADDlg1.BackColor
  188.         Lead1.GradientStartColor = Form1.LEADDlg1.StartColor
  189.         Lead1.GradientEndColor = Form1.LEADDlg1.EndColor
  190.         'shape borders
  191.         Lead1.ShapeBorderStyle = Form1.LEADDlg1.ShapeBorderStyle
  192.         Lead1.ShapeInnerBandStyle = Form1.LEADDlg1.ShapeInnerStyle
  193.         Lead1.ShapeOuterBandStyle = Form1.LEADDlg1.ShapeOuterStyle
  194.         Lead1.ShapeBorderColor = Form1.LEADDlg1.ShapeBorderColor
  195.         Lead1.ShapeInnerBandHiliteColor = Form1.LEADDlg1.ShapeInnerHiliteColor
  196.         Lead1.ShapeOuterBandHiliteColor = Form1.LEADDlg1.ShapeOuterHiliteColor
  197.         Lead1.ShapeInnerBandShadowColor = Form1.LEADDlg1.ShapeInnerShadowColor
  198.         Lead1.ShapeOuterBandShadowColor = Form1.LEADDlg1.ShapeOuterShadowColor
  199.         Lead1.ShapeBorderThickness = Form1.LEADDlg1.ShapeBorderWidth
  200.         Lead1.ShapeInnerBandThickness = Form1.LEADDlg1.ShapeInnerWidth
  201.         Lead1.ShapeOuterBandThickness = Form1.LEADDlg1.ShapeOuterWidth
  202.         
  203.         'setup the shape location
  204.         Lead1.ShapeTop = Lead1.ScaleHeight * 0.1
  205.         Lead1.ShapeLeft = Lead1.ScaleWidth * 0.1
  206.         Lead1.ShapeWidth = Lead1.ScaleWidth * 0.8
  207.         Lead1.ShapeHeight = Lead1.ScaleHeight * 0.8
  208.         
  209.         'paint the image
  210.         Lead1.PaintEffect = Form1.gnMainEffect
  211.         Lead1.PaintPass = 1
  212.         Lead1.PaintMaxPasses = 1
  213.         Lead1.AutoRepaint = True
  214.         
  215.         'draw the shape
  216.         If ((Lead1.ShapeBackgroundStyle = EFX_BACKSTYLE_TILED_IMAGE) Or _
  217.             (Lead1.ShapeBackgroundStyle = EFX_BACKSTYLE_TRANSLUCENT_TILED_IMAGE)) Then
  218.             'setup the background image
  219.             Form1.Lead2.Bitmap = Form1.LEADDlg1.ShapeBackgroundBitmap
  220.             Lead1.BackgroundImageTop = 0
  221.             Lead1.BackgroundImageLeft = 0
  222.             Lead1.BackgroundImageWidth = Form1.Lead2.BitmapWidth
  223.             Lead1.BackgroundImageHeight = Form1.Lead2.BitmapHeight
  224.             Lead1.DrawShape Form1.LEADDlg1.Shape, Form1.Lead2.Bitmap
  225.         Else
  226.             'draw the shape
  227.             Lead1.DrawShape Form1.LEADDlg1.Shape, 0
  228.         End If
  229.     End If
  230.     Lead1.AutoRepaint = True
  231. End Sub
  232. Private Sub Form_KeyPress(KeyAscii As Integer)
  233.     Lead1.BackErase = False
  234.     If KeyAscii = vbKeyEscape Then
  235.         gQuit = True
  236.     End If
  237. End Sub
  238. Private Sub Form_Load()
  239.     Dim fOK As Integer
  240.     Dim nValue As Integer
  241.     Dim fChecked As Integer
  242.     gDelay = 0
  243.     gFirstText = True
  244.     gFirstShape = True
  245.     Load GetValueFrm
  246.     GetValueInitTheForm "Slide Delay", "Milliseconds:", 5000, 0, CInt(gDelay), 10, 1, False
  247.     GetValueFrm.Show 1
  248.     GetValueGetUserSelections fOK, nValue, fChecked
  249.     Unload GetValueFrm
  250.     If fOK Then
  251.         gDelay = nValue
  252.     End If
  253.     Top = 0
  254.     Left = 0
  255.     Width = Screen.Width
  256.     Height = Screen.Height
  257.     Lead1.Top = 0
  258.     Lead1.Left = 0
  259.     Lead1.Width = Width
  260.     Lead1.Height = Height
  261.     Lead1.PaintSizeMode = PAINTSIZEMODE_FIT 'SIDES
  262.     Lead1.Font.Name = Form1.Lead1.Font.Name
  263.     Lead1.Font.Size = Form1.Lead1.Font.Size
  264.     Lead1.Font.Bold = Form1.Lead1.Font.Bold
  265.     Lead1.Font.Italic = Form1.Lead1.Font.Italic
  266.     Lead1.Font.Charset = Form1.Lead1.Font.Charset
  267.     Lead1.Font.Strikethrough = Form1.Lead1.Font.Strikethrough
  268.     Lead1.Font.Underline = Form1.Lead1.Font.Underline
  269.     Lead1.Font.Weight = Form1.Lead1.Font.Weight
  270.     gMultiPass = False
  271.     gQuit = False
  272.     Timer1.Interval = 300
  273.     Timer1.Enabled = True
  274. End Sub
  275. Private Sub Lead1_PaintNotification(ByVal uPass As Integer, ByVal uType As Integer)
  276.     Lead1.EnableProgressEvent = True
  277.     If (gMultiPass = True) Then
  278.         If ((uType = EFX_NOTIFY_IMAGE) And (uPass >= 0) And (uPass < Lead1.PaintMaxPasses)) Then
  279.             Lead1.PaintEffect = Form1.GetMultiEffect(uPass + 1)
  280.         End If
  281.     End If
  282.     If ((uType = EFX_NOTIFY_IMAGE) And (uPass = 0)) Then
  283.         'set the effect delay for the main bitmap
  284.         Lead1.EffectDelay = Form1.gnMainDelay
  285.         'set the grain size for the main bitmap
  286.         Lead1.EffectGrain = Form1.gnMainGrain
  287.         'set the wand size for the main bitmap
  288.         Lead1.WandSize = Form1.gnMainWandWidth
  289.         'set the wand color for the main bitmap
  290.         Lead1.WandColor = Form1.gclrMainWandColor
  291.         'Transparency for the main bitmap?
  292.         Lead1.UseTransparentColor = Form1.gbMainTransparent
  293.         Lead1.TransparentColor = Form1.gclrMainTransparentColor
  294.     End If
  295.     If ((uType = EFX_NOTIFY_TRANSITION) And (uPass = Lead1.PaintMaxPasses)) Then
  296.         'set the colors
  297.         Lead1.PatternForeColor = Form1.LEADDlg1.ForeColor
  298.         Lead1.PatternBackColor = Form1.LEADDlg1.BackColor
  299.         Lead1.GradientStartColor = Form1.LEADDlg1.StartColor
  300.         Lead1.GradientEndColor = Form1.LEADDlg1.EndColor
  301.     End If
  302. End Sub
  303. Private Sub Lead1_ProgressStatus(ByVal iPercent As Integer)
  304.     DoEvents
  305.     If gQuit = True Then
  306.         Lead1.EnableProgressEvent = False
  307.         Lead1.PaintEffect = EFX_EFFECT_NONE
  308.         Lead1.TransitionEffect = EFX_EFFECT_NONE
  309.         Lead1.PaintMaxPasses = 1
  310.     End If
  311. End Sub
  312. Private Sub Timer1_Timer()
  313.     Timer1.Interval = 0
  314.     Dim x As Long
  315.     For x = 0 To Form1.ImageNameList.ListCount - 1
  316.         Lead1.AutoRepaint = False
  317.         Lead1.BackErase = False
  318.         Lead1.AutoScroll = False
  319.         Lead1.ScaleMode = 3
  320.         Lead1.EnableProgressEvent = False
  321.         Lead1.Load Form1.ImageNameList.List(x), 0, 0, 1
  322.         Lead1.EnableProgressEvent = True
  323.         ShowImage
  324.         If gQuit = True Then GoTo OUT
  325.         Call Sleep(gDelay)
  326.     Next x
  327.     Hide
  328. End Sub
  329.