Attribute VB_Name = "KlientMod"
Public InFontText As TextBox
Global dllErrs As Variant

Sub previewImage()
On Error Resume Next
With client
    Dim boo As Boolean, x As Integer, y As Integer, pw As Integer, ph As Integer
    .img(0) = LoadPicture(.txt(4))
    .pic(0).BackColor = &HFFFFFF * -CInt(Not boo)
    pw = .img(0).Width
    ph = .img(0).Height
    boo = .ch(0).Value = 1
    .pic(0).Cls
        If Not boo Then
Centrar:
            With .pic(0)
            Set w = Nothing
            Set h = Nothing
            x = (.Width / 2) - (pw / 2)
            y = (.Height / 2) - (ph / 2)
            If x < 0 Then x = 0
            If y < 0 Then y = 0
            End With
            .pic(0).PaintPicture .img(0), x, y
        Else
            If .cb(1).ListIndex = 0 Then
                .pic(0).PaintPicture .img(0), x, y, .pic(0).Width, .pic(0).Height
            ElseIf .cb(1).ListIndex = 1 Then
                .pic(0).BackColor = 0
                GoTo Centrar
            ElseIf .cb(1).ListIndex = 2 Then
                For a = 0 To .pic(0).Width Step pw
                    For b = 0 To .pic(0).Height Step ph
                    .pic(0).PaintPicture .img(0), a, b, pw, ph
                    Next b
                Next a
            End If
        End If
End With
End Sub
