j'ai eu à faire un programmeau forme original, j'ai fait ça à l'aide de la transparence (cherche ce terme sur le forum).
En fait il te suffis d'appliquer la transparence à ta form, et si tu as par exemple une image possée sur cette form, ta form prendra les contours de l'image !
voilà le code, qui vient d'ici si je me souviens bien, donc merci à son auteur !
par contre c'est du vb6 !!! donc à adapter certainement si tu es en .net....
dans un module
-----------------------------------------------------------------------------
Public Declare Function GetPixel Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long) As Long
Public Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Public Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Public Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Public Declare Function ReleaseCapture Lib "user32" () As Long
Public Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const WM_NCLBUTTONDOWN = &HA1
Public Const HTCAPTION = 2
Public Const RGN_OR = 2
Public Function MakeRegion(picSkin As PictureBox) As Long
' faites une fenêtre "région" basée sur une picture de picture box
' Ceci ce fait en passant l'image pixel par pixel et en créant une
' région pour chaque pixel non transparent
' Le code est optimisé, il est donc assez rapide
Dim X As Long, Y As Long, StartLineX As Long
Dim FullRegion As Long, LineRegion As Long
Dim TransparentColor As Long
Dim InFirstRegion As Boolean
Dim InLine As Boolean
Dim hDC As Long
Dim PicWidth As Long
Dim PicHeight As Long
hDC = picSkin.hDC
PicWidth = picSkin.ScaleWidth
PicHeight = picSkin.ScaleHeight
InFirstRegion = True: InLine = False
X = Y = StartLineX = 0
' Ici, la couleur de transparence est basé sur le pixel en haut a gauche
' Mais vous pouvez mettre la couleur ke vous voulez
TransparentColor = GetPixel(hDC, 0, 0)
For Y = 0 To PicHeight - 1
For X = 0 To PicWidth - 1
If GetPixel(hDC, X, Y) = TransparentColor Or X = PicWidth Then
If InLine Then
InLine = False
LineRegion = CreateRectRgn(StartLineX, Y, X, Y + 1)
If InFirstRegion Then
FullRegion = LineRegion
InFirstRegion = False
Else
CombineRgn FullRegion, FullRegion, LineRegion, RGN_OR
DeleteObject LineRegion
End If
End If
Else
If Not InLine Then
InLine = True
StartLineX = X
End If
End If
Next
Next
MakeRegion = FullRegion
End Function
--------------------------------------------------------------
**********************************************
puis dans ton forma load, tu rajoutes un truc du genre :
--------------------------------------------------------------
Dim WindowRegion As Long
'Propriétés de la picture box
Picture1.AutoRedraw = True
Picture1.AutoSize = True
Picture1.BorderStyle = 0
Picture1.ScaleMode = 3
'Position de la picture box
Picture1.Top = 0: Picture1.Left = 0
'"Découpe" la form suivant Picture1
WindowRegion = MakeRegion(Picture1)
SetWindowRgn Me.hWnd, WindowRegion, True
--------------------------------------------------------------
**********************************************