vbAccelerator - Contents of code file: frmCodecs.frmVERSION 5.00
Begin VB.Form frmCodecs
BorderStyle = 3 'Fixed Dialog
Caption = "Available Encoder and Decoders"
ClientHeight = 5910
ClientLeft = 45
ClientTop = 435
ClientWidth = 5250
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5910
ScaleWidth = 5250
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton cmdOK
Caption = "OK"
Height = 435
Left = 3900
TabIndex = 6
Top = 5400
Width = 1275
End
Begin VB.ListBox lstEncoders
Height = 1425
Left = 120
TabIndex = 2
Top = 2100
Width = 5055
End
Begin VB.ListBox lstDecoders
Height = 1425
Left = 120
TabIndex = 1
Top = 360
Width = 5055
End
Begin VB.ListBox lstEncoderParameters
Height = 1425
Left = 120
TabIndex = 0
Top = 3780
Width = 5055
End
Begin VB.Line Line1
BorderColor = &H80000000&
X1 = 120
X2 = 5160
Y1 = 5340
Y2 = 5340
End
Begin VB.Label lblDecoders
Caption = "&Decoders:"
Height = 255
Left = 120
TabIndex = 5
Top = 60
Width = 4995
End
Begin VB.Label lblEncoders
Caption = "&Encoders:"
Height = 255
Left = 120
TabIndex = 4
Top = 1800
Width = 5055
End
Begin VB.Label lblEncoderParameters
Caption = "Encoder &Parameters:"
Height = 255
Left = 120
TabIndex = 3
Top = 3540
Width = 4995
End
End
Attribute VB_Name = "frmCodecs"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub showCodecs()
Dim cCodec As GDIPImageCodec
Dim i As Long
For i = 1 To g_cDecoders.count
Set cCodec = g_cDecoders.Item(i)
lstDecoders.AddItem cCodec.FormatDescription & vbTab & cCodec.MimeType &
vbTab & cCodec.FilenameExtension
Next i
lstDecoders.ListIndex = 0
For i = 1 To g_cEncoders.count
Set cCodec = g_cEncoders.Item(i)
lstEncoders.AddItem cCodec.FormatDescription & vbTab & cCodec.MimeType &
vbTab & cCodec.FilenameExtension
Next i
lstEncoders.ListIndex = 0
End Sub
Private Sub Form_Load()
showCodecs
Me.Icon = Forms(0).Icon
End Sub
Private Sub lstEncoders_Click()
lstEncoderParameters.Clear
Dim bm As GDIPBitmap
Set bm = New GDIPBitmap
bm.CreateFromSize 1, 1
If Not (bm Is Nothing) Then
Dim cL As GDIPEncoderParameterList
Set cL =
bm.image.EncoderParameterList(g_cEncoders.Item(lstEncoders.ListIndex +
1).CodecCLSID)
Dim i As Long
Dim sItem As String
Dim valueCount As Long
Dim j As Long
For i = 1 To cL.count
sItem = cL.Parameter(i).Name
valueCount = cL.Parameter(i).AllowableValueCount
If (valueCount > 0) Then
sItem = sItem & " (" & valueCount & " values"
If (cL.Parameter(i).ParamType = EncoderParameterValueTypeLongRange)
Then
If (valueCount = 1) Then
Dim v As Variant
v = cL.Parameter(i).AllowableValue(1)
sItem = sItem & " - from " & v(1) & " to " & v(2)
End If
ElseIf (cL.Parameter(i).ParamType = EncoderParameterValueTypeLong)
Then
sItem = sItem & " - "
For j = 1 To valueCount
sItem = sItem & " " & cL.Parameter(i).AllowableValue(j)
Next j
End If
sItem = sItem & ")"
Else
sItem = sItem & " (No allowed values)"
End If
lstEncoderParameters.AddItem sItem
Next i
End If
End Sub
Private Sub cmdOK_Click()
Unload Me
End Sub
|
|