La tour eiffel

Soyez le premier à donner votre avis sur cette source.

Vue 6 104 fois - Téléchargée 524 fois

Description

Voici la TourEiffel,il est dans le zip !!!!!

TourEiffel.zip (52,2 ko)

Source / Exemple :


Option Explicit
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Type POINTAPI
   X As Long
   Y As Long
End Type
Private Const RGN_COPY = 5
Private Const CreatedBy = "VBSFC 6.2"
Private Const RegisteredTo = "Not Registered"
Private ResultRegion As Long
Private Function CreateFormRegion(ScaleX As Single, ScaleY As Single, OffsetX As Integer, OffsetY As Integer) As Long
    Dim HolderRegion As Long, ObjectRegion As Long, nRet As Long, Counter As Integer
    Dim PolyPoints() As POINTAPI
    ResultRegion = CreateRectRgn(0, 0, 0, 0)
    HolderRegion = CreateRectRgn(0, 0, 0, 0)

    ReDim PolyPoints(0 To 44)
    For Counter = 0 To 44
        PolyPoints(Counter).X = GP0X(Counter) * ScaleX * 15 / Screen.TwipsPerPixelX + OffsetX
        PolyPoints(Counter).Y = GP0Y(Counter) * ScaleY * 15 / Screen.TwipsPerPixelY + OffsetY
    Next Counter
    ObjectRegion = CreatePolygonRgn(PolyPoints(0), 45, 1)
    nRet = CombineRgn(ResultRegion, ObjectRegion, ObjectRegion, RGN_COPY)
    DeleteObject ObjectRegion
    ReDim PolyPoints(0 To 4)
    For Counter = 0 To 4
        PolyPoints(Counter).X = GP1X(Counter) * ScaleX * 15 / Screen.TwipsPerPixelX + OffsetX
        PolyPoints(Counter).Y = GP1Y(Counter) * ScaleY * 15 / Screen.TwipsPerPixelY + OffsetY
    Next Counter
    ObjectRegion = CreatePolygonRgn(PolyPoints(0), 5, 1)
    nRet = CombineRgn(HolderRegion, ResultRegion, ResultRegion, RGN_COPY)
    nRet = CombineRgn(ResultRegion, HolderRegion, ObjectRegion, 4)
    DeleteObject ObjectRegion
    DeleteObject HolderRegion
    CreateFormRegion = ResultRegion
End Function
Private Function GP0X(Number As Integer) As Integer
    Select Case Number
    Case 0
        GP0X = 118
    Case 1
        GP0X = 117
    Case 2
        GP0X = 109
    Case 3
        GP0X = 107
    Case 4
        GP0X = 112
    Case 5
        GP0X = 108
    Case 6
        GP0X = 102
    Case 7
        GP0X = 97
    Case 8
        GP0X = 98
    Case 9
        GP0X = 92
    Case 10
        GP0X = 94
    Case 11
        GP0X = 98
    Case 12
        GP0X = 80
    Case 13
        GP0X = 71
    Case 14
        GP0X = 68
    Case 15
        GP0X = 68
    Case 16
        GP0X = 39
    Case 17
        GP0X = 71
    Case 18
        GP0X = 85
    Case 19
        GP0X = 99
    Case 20
        GP0X = 114
    Case 21
        GP0X = 132
    Case 22
        GP0X = 149
    Case 23
        GP0X = 159
    Case 24
        GP0X = 172
    Case 25
        GP0X = 180
    Case 26
        GP0X = 211
    Case 27
        GP0X = 177
    Case 28
        GP0X = 180
    Case 29
        GP0X = 178
    Case 30
        GP0X = 170
    Case 31
        GP0X = 151
    Case 32
        GP0X = 154
    Case 33
        GP0X = 150
    Case 34
        GP0X = 145
    Case 35
        GP0X = 144
    Case 36
        GP0X = 140
    Case 37
        GP0X = 133
    Case 38
        GP0X = 128
    Case 39
        GP0X = 133
    Case 40
        GP0X = 132
    Case 41
        GP0X = 123
    Case 42
        GP0X = 122
    Case 43
        GP0X = 121
    Case 44
        GP0X = 117
    End Select
End Function
Private Function GP0Y(Number As Integer) As Integer
    Select Case Number
    Case 0
        GP0Y = 43
    Case 1
        GP0Y = 72
    Case 2
        GP0Y = 78
    Case 3
        GP0Y = 92
    Case 4
        GP0Y = 105
    Case 5
        GP0Y = 245
    Case 6
        GP0Y = 299
    Case 7
        GP0Y = 308
    Case 8
        GP0Y = 312
    Case 9
        GP0Y = 311
    Case 10
        GP0Y = 318
    Case 11
        GP0Y = 321
    Case 12
        GP0Y = 388
    Case 13
        GP0Y = 388
    Case 14
        GP0Y = 403
    Case 15
        GP0Y = 408
    Case 16
        GP0Y = 473
    Case 17
        GP0Y = 475
    Case 18
        GP0Y = 445
    Case 19
        GP0Y = 435
    Case 20
        GP0Y = 429
    Case 21
        GP0Y = 428
    Case 22
        GP0Y = 433
    Case 23
        GP0Y = 443
    Case 24
        GP0Y = 458
    Case 25
        GP0Y = 475
    Case 26
        GP0Y = 474
    Case 27
        GP0Y = 406
    Case 28
        GP0Y = 398
    Case 29
        GP0Y = 389
    Case 30
        GP0Y = 389
    Case 31
        GP0Y = 326
    Case 32
        GP0Y = 312
    Case 33
        GP0Y = 306
    Case 34
        GP0Y = 301
    Case 35
        GP0Y = 291
    Case 36
        GP0Y = 273
    Case 37
        GP0Y = 190
    Case 38
        GP0Y = 104
    Case 39
        GP0Y = 96
    Case 40
        GP0Y = 79
    Case 41
        GP0Y = 70
    Case 42
        GP0Y = 53
    Case 43
        GP0Y = 42
    Case 44
        GP0Y = 42
    End Select
End Function
Private Function GP1X(Number As Integer) As Integer
    Select Case Number
    Case 0
        GP1X = 113
    Case 1
        GP1X = 135
    Case 2
        GP1X = 142
    Case 3
        GP1X = 106
    Case 4
        GP1X = 112
    End Select
End Function
Private Function GP1Y(Number As Integer) As Integer
    Select Case Number
    Case 0
        GP1Y = 342
    Case 1
        GP1Y = 343
    Case 2
        GP1Y = 387
    Case 3
        GP1Y = 387
    Case 4
        GP1Y = 342
    End Select
End Function

Private Sub Form_Load()
    Dim nRet As Long
    nRet = SetWindowRgn(Me.hWnd, CreateFormRegion(1, 1, 0, 0), True)
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ReleaseCapture
    SendMessage Me.hWnd, &HA1, 2, 0&
End Sub
Private Sub Form_Unload(Cancel As Integer)
    DeleteObject ResultRegion
End Sub

Codes Sources

A voir également

Ajouter un commentaire Commentaires
Messages postés
565
Date d'inscription
mercredi 19 mai 2004
Statut
Membre
Dernière intervention
30 avril 2008
1
je viens seulement de voir ton code... mais en tt casd je t mis 10 parceke pr faire ca tu a du un peut te peter les ........ lol alors gg
Messages postés
122
Date d'inscription
mercredi 25 février 2004
Statut
Membre
Dernière intervention
2 juillet 2014

J'ai regardé pour le fun, original, le truc indispensable lol
Messages postés
17
Date d'inscription
samedi 9 décembre 2000
Statut
Membre
Dernière intervention
6 mai 2007

ya d moyens plus simple et plus courts pour obtenir un résultat bien meilleurs...
Messages postés
438
Date d'inscription
vendredi 9 mai 2003
Statut
Membre
Dernière intervention
26 juillet 2007
3
Alors la chapo!!! ca g pas compris tout le fonctionnement... mais chapo... g controlé 5 fois si yavait pas 2 images... lol...
ps, chuis pas francais non plus, mais ca peut aider monstre...
J'avoue ne pas saisir pleinement l'interêt de la chose, mais il est vrai que l'élan pas triotique est sûrement pour qqchse ds votre engouement. N'étant pas français, ça me laisse un peu froid.
Afficher les 9 commentaires

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.