OVH Cloud OVH Cloud

Image d'arrière plan

3 réponses
Avatar
Antoine Labusquière
Bonjour,

Dans une feuille, je cherche à mettre une petite image d'arrière plan, et
l'afficher en mosaïque.
C'est possible ?

J'ai rien trouvé qui corresponde...

Merci

3 réponses

Avatar
Jacques Thiery
Voici un code qui je crois te conviendra

Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X
As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal
hSrcDC As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As Long)
As Long
Const SRCCOPY = &HCC0020


Private Sub Form_Resize()
Form1.Picture1.AutoRedraw = True
Form1.Picture1.ScaleMode = PIXELS
sDC! = Form1.Picture1.hDC
dDC! = Form1.hDC
sH = Form1.Picture1.ScaleHeight
sW = Form1.Picture1.ScaleWidth
Rows = Form1.ScaleWidth sW
cols = Form1.ScaleHeight sH
For I = 0 To Rows
dX = I * sW
For J = 0 To cols
dY = J * sH
RET = BitBlt(dDC!, dX, dY, sW, sH, sDC!, sX, sY, SRCCOPY)
Next J
Next I
Form1.Refresh
End Sub

Form1 est la form qui contient un picturebox Picture1 dans lequel tu mets
l'image que tu veux repeter
je pense avoir repondu a ta question


"Antoine Labusquière" a écrit dans le
message de news:cq8sol$f0s$
Bonjour,

Dans une feuille, je cherche à mettre une petite image d'arrière plan, et
l'afficher en mosaïque.
C'est possible ?

J'ai rien trouvé qui corresponde...

Merci




Avatar
Jacques Thiery
Voici un code qui je crois te conviendra

Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X
As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal
hSrcDC As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As Long)
As Long
Const SRCCOPY = &HCC0020


Private Sub Form_Resize()
Form1.Picture1.AutoRedraw = True
Form1.Picture1.ScaleMode = PIXELS
sDC! = Form1.Picture1.hDC
dDC! = Form1.hDC
sH = Form1.Picture1.ScaleHeight
sW = Form1.Picture1.ScaleWidth
Rows = Form1.ScaleWidth sW
cols = Form1.ScaleHeight sH
For I = 0 To Rows
dX = I * sW
For J = 0 To cols
dY = J * sH
RET = BitBlt(dDC!, dX, dY, sW, sH, sDC!, sX, sY, SRCCOPY)
Next J
Next I
Form1.Refresh
End Sub

Form1 est la form (propriété autoRedraw a True) qui contient un picturebox
Picture1 dans lequel tu mets
l'image que tu veux repeter
je pense avoir repondu a ta question



"Antoine Labusquière" a écrit dans le
message de news:cq8sol$f0s$
Bonjour,

Dans une feuille, je cherche à mettre une petite image d'arrière plan, et
l'afficher en mosaïque.
C'est possible ?

J'ai rien trouvé qui corresponde...

Merci




Avatar
Antoine Labusquière
Merci beaucoup.

Je vais essayer ça.


"Jacques Thiery" a écrit dans le message de
news:41c9288b$0$1495$
Voici un code qui je crois te conviendra

Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal


X
As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long,


ByVal
hSrcDC As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As


Long)
As Long
Const SRCCOPY = &HCC0020


Private Sub Form_Resize()
Form1.Picture1.AutoRedraw = True
Form1.Picture1.ScaleMode = PIXELS
sDC! = Form1.Picture1.hDC
dDC! = Form1.hDC
sH = Form1.Picture1.ScaleHeight
sW = Form1.Picture1.ScaleWidth
Rows = Form1.ScaleWidth sW
cols = Form1.ScaleHeight sH
For I = 0 To Rows
dX = I * sW
For J = 0 To cols
dY = J * sH
RET = BitBlt(dDC!, dX, dY, sW, sH, sDC!, sX, sY, SRCCOPY)
Next J
Next I
Form1.Refresh
End Sub

Form1 est la form qui contient un picturebox Picture1 dans lequel tu mets
l'image que tu veux repeter
je pense avoir repondu a ta question


"Antoine Labusquière" a écrit dans le
message de news:cq8sol$f0s$
> Bonjour,
>
> Dans une feuille, je cherche à mettre une petite image d'arrière plan,


et
> l'afficher en mosaïque.
> C'est possible ?
>
> J'ai rien trouvé qui corresponde...
>
> Merci
>
>