IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VB.NET Discussion :

convertion source vb6, je coince :-(


Sujet :

VB.NET

Mode arborescent

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    362
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 362
    Par défaut convertion source vb6, je coince :-(
    bonjour je cherche a convertir cette source vb6 en vb.net mais je coince.
    Il sagit d'un system de zoom dans une picturebox avec regle graduée... je souhaite m'en servir dans mon projet mais pour la convertion en vb.net je bloque sur :
    .currentX
    .currentY
    .print
    .cls

    je sais qu'il faut passer par ce genre de chose:

    Public picContainer As System.Drawing.Bitmap
    Public f As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(picContainer)

    et avec f.drawline pour tracer des traits ect.... mais quand j'essai mon resultat n'est pas fonctionnel :-(

    a l'avance , merci pour votre aide


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    Option Explicit
    Public sngZPLZoom       As Single
     
    Private Sub Form_Load()
        picZPLView.Cls
        sngZPLZoom = 6
        picZPLView.Width = (txtEtiquette(0).Text * sngZPLZoom) + &H2
        picZPLView.Height = (txtEtiquette(0).Text * sngZPLZoom) + &H6
        Call Form_Resize
      End Sub
     
    Private Sub Form_Unload(Cancel As Integer)
        Unload frmPrincipal                                     ' DECHARGMENT DE LA FENETRE.
        Set frmPrincipal = Nothing                              ' RESTAURATION DE LA MEMOIRE.
        picZPLView.Cls
    End Sub
     
    Private Sub Form_Resize()
    ' DECLARATION DES VARIABLES.
        Dim lngX        As Long
        Dim lngY        As Long
        Dim lngI        As Long
        Dim lngJ        As Long
        Dim sngI        As Single
     
    ' POSITIONNEMENT DES OBJETS.
        If frmPrincipal.WindowState <> 1 Then
            lngX = frmPrincipal.Width / Screen.TwipsPerPixelX
            lngY = frmPrincipal.Height / Screen.TwipsPerPixelY
            picContainer.Width = lngX - 8
            picContainer.Height = lngY - 105
     
            picZPLView.Left = (picContainer.Width - picZPLView.Width) / 2
            picZPLView.Top = (picContainer.Height - picZPLView.Height) / 2
     
    ' AFFICHAGE DE LA REGLE DE GRANDEUR.
            picContainer.Cls
            picContainer.Line (picZPLView.Left, 0)-(picZPLView.Left, picContainer.Height), &H666666
            picContainer.Line ((picZPLView.Left + picZPLView.Width) - 1, 0)-((picZPLView.Left + picZPLView.Width) - 1, picContainer.Height), &H666666
            picContainer.Line (&H0, picZPLView.Top)-(picContainer.Width, picZPLView.Top), &H666666
            picContainer.Line (&H0, (picZPLView.Top + picZPLView.Height) - 1)-(picContainer.Width, (picZPLView.Top + picZPLView.Height) - 1), &H666666
            lngI = 0
            For sngI = ((picZPLView.Width) / txtEtiquette(0).Text) To picZPLView.Width - 1 Step ((picZPLView.Width) / txtEtiquette(0).Text)
                lngI = lngI + 1
                If lngI < 10 Then
                    If lngI <> 5 Then
                        picContainer.Line (picZPLView.Left + sngI, picZPLView.Top - 4)-(picZPLView.Left + sngI, picZPLView.Top), &H880000
                        picContainer.Line (picZPLView.Left + sngI, (picZPLView.Top + picZPLView.Height))-(picZPLView.Left + sngI, (picZPLView.Top + picZPLView.Height) + 4), &H880000
                        Else
                            picContainer.Line (picZPLView.Left + sngI, picZPLView.Top - 8)-(picZPLView.Left + sngI, picZPLView.Top), &H880000
                            picContainer.Line (picZPLView.Left + sngI, (picZPLView.Top + picZPLView.Height))-(picZPLView.Left + sngI, (picZPLView.Top + picZPLView.Height) + 8), &H880000
                    End If
                    Else
                        lngI = 0
                        lngJ = lngJ + 10
                        picContainer.Line (picZPLView.Left + sngI, picZPLView.Top - 18)-(picZPLView.Left + sngI, picZPLView.Top), &H880000
                        picContainer.Line (picZPLView.Left + sngI, (picZPLView.Top + picZPLView.Height))-(picZPLView.Left + sngI, (picZPLView.Top + picZPLView.Height) + 18), &H880000
                        picContainer.CurrentX = ((picZPLView.Left + sngI) - (picContainer.TextWidth(lngJ) / 2)) - 4
                        picContainer.CurrentY = picZPLView.Top - 32
                        picContainer.ForeColor = 0
                        picContainer.Print lngJ
                        picContainer.CurrentX = ((picZPLView.Left + sngI) - (picContainer.TextWidth(lngJ) / 2)) - 4
                        picContainer.CurrentY = picZPLView.Top - 33
                        picContainer.ForeColor = &HFFFFFF
                        picContainer.Print lngJ
                        picContainer.CurrentX = ((picZPLView.Left + sngI) - (picContainer.TextWidth(lngJ) / &H2)) - &H4
                        picContainer.CurrentY = picZPLView.Top + picZPLView.Height + &H11
                        picContainer.ForeColor = 0
                        picContainer.Print lngJ
                        picContainer.CurrentX = ((picZPLView.Left + sngI) - (picContainer.TextWidth(lngJ) / &H2)) - &H5
                        picContainer.CurrentY = picZPLView.Top + picZPLView.Height + &H10
                        picContainer.ForeColor = &HFFFFFF
                        picContainer.Print lngJ
                End If
            Next sngI
            lngI = 0
            lngJ = 0
            For sngI = ((picZPLView.Height) / txtEtiquette(1).Text) To picZPLView.Height - &H1 Step ((picZPLView.Height) / txtEtiquette(1).Text)
                lngI = lngI + 1
                If lngI < 10 Then
                    If lngI <> 5 Then
                        picContainer.Line (picZPLView.Left - 4, picZPLView.Top + sngI)-(picZPLView.Left, picZPLView.Top + sngI), &H880000
                        picContainer.Line ((picZPLView.Left + picZPLView.Width), picZPLView.Top + sngI)-((picZPLView.Left + picZPLView.Width) + &H4, picZPLView.Top + sngI), &H880000
                        Else
                            picContainer.Line (picZPLView.Left - &H8, picZPLView.Top + sngI)-(picZPLView.Left, picZPLView.Top + sngI), &H880000
                            picContainer.Line ((picZPLView.Left + picZPLView.Width), picZPLView.Top + sngI)-((picZPLView.Left + picZPLView.Width) + &H8, picZPLView.Top + sngI), &H880000
                    End If
                    Else
                        lngI = &H0
                        lngJ = lngJ + 10
                        picContainer.Line (picZPLView.Left - 18, picZPLView.Top + sngI)-(picZPLView.Left, picZPLView.Top + sngI), &H880000
                        picContainer.Line ((picZPLView.Left + picZPLView.Width), picZPLView.Top + sngI)-((picZPLView.Left + picZPLView.Width) + 18, picZPLView.Top + sngI), &H880000
                        picContainer.CurrentX = picZPLView.Left - (picContainer.TextWidth(lngJ) + &H1A)
                        picContainer.CurrentY = ((picZPLView.Top + sngI) - (picContainer.TextHeight(lngJ) / &H2))
                        picContainer.ForeColor = &H0
                        picContainer.Print lngJ
                        picContainer.CurrentX = picZPLView.Left - (picContainer.TextWidth(lngJ) + &H1B)
                        picContainer.CurrentY = ((picZPLView.Top + sngI) - (picContainer.TextHeight(lngJ) / &H2)) - &H1
                        picContainer.ForeColor = &HFFFFFF
                        picContainer.Print lngJ
                        picContainer.CurrentX = (picZPLView.Left + picZPLView.Width) + 18
                        picContainer.CurrentY = ((picZPLView.Top + sngI) - (picContainer.TextHeight(lngJ) / &H2))
                        picContainer.ForeColor = &H0
                        picContainer.Print lngJ
                        picContainer.CurrentX = (picZPLView.Left + picZPLView.Width) + &H11
                        picContainer.CurrentY = ((picZPLView.Top + sngI) - (picContainer.TextHeight(lngJ) / &H2)) - &H1
                        picContainer.ForeColor = &HFFFFFF
                        picContainer.Print lngJ
                End If
            Next sngI
        End If
     
    End Sub
     
    Private Sub cmdAction_Click(Index As Integer)
        Select Case Index
            Case &H2:    
                            sngZPLZoom = 6.2
                            picZPLView.Cls
                            picZPLView.Width = (txtEtiquette(&H0).Text * sngZPLZoom) + &H2
                            picZPLView.Height = (txtEtiquette(&H1).Text * sngZPLZoom) + &H6
                            Call Form_Resize
            Case &H3:
                            If sngZPLZoom < 10 Then
                                sngZPLZoom = sngZPLZoom + 0.2
                                picZPLView.Cls
                                picZPLView.Width = (txtEtiquette(&H0).Text * sngZPLZoom) + &H2
                                picZPLView.Height = (txtEtiquette(&H1).Text * sngZPLZoom) + &H6
                                Call Form_Resize
                            End If
            Case &H4:
                            If sngZPLZoom > 2.4 Then
                                sngZPLZoom = sngZPLZoom - 0.2
                                picZPLView.Cls
                                picZPLView.Width = (txtEtiquette(&H0).Text * sngZPLZoom) + &H2
                                picZPLView.Height = (txtEtiquette(&H1).Text * sngZPLZoom) + &H6
                                Call Form_Resize
                            End If
        End Select
    End Sub
    Fichiers attachés Fichiers attachés

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 3
    Dernier message: 04/11/2014, 17h37
  2. code source vb6
    Par marwa 18 dans le forum VB 6 et antérieur
    Réponses: 3
    Dernier message: 29/03/2010, 10h09
  3. taille du code source vb6
    Par NAIMA2 dans le forum VB 6 et antérieur
    Réponses: 8
    Dernier message: 21/03/2007, 13h58
  4. [VB6] Code source pour modifier MsgBox
    Par khany dans le forum VB 6 et antérieur
    Réponses: 5
    Dernier message: 25/02/2003, 15h13

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo