cs_Cerber
Messages postés31Date d'inscriptiondimanche 1 avril 2001StatutMembreDernière intervention 5 décembre 2002
-
21 nov. 2002 à 05:03
cs_Cerber
Messages postés31Date d'inscriptiondimanche 1 avril 2001StatutMembreDernière intervention 5 décembre 2002
-
21 nov. 2002 à 21:11
Salut, quelqu'un peut il m'aider ? Je n'arrive pas à utiliser la fonction transparentBlt de la dll MSIMG32. L'exemple fourni dans la msdn ne marche pas. Je pense qu'il me faudrait juste la déclaration :
Public Declare Function transparentBlt Lib "msimg32" etc... qui marche :)
cs_DARKSIDIOUS
Messages postés15814Date d'inscriptionjeudi 8 août 2002StatutMembreDernière intervention 4 mars 2013130 21 nov. 2002 à 06:14
Salut Cerber,
Va voir dans mes sources celle qui s'appelle Aide sur les principales API, tu y trouvera un fichier d'aide (en français) qui t'expliquera le fonctionnement de cette api.
BasicInstinct
Messages postés1470Date d'inscriptionmardi 5 février 2002StatutMembreDernière intervention20 octobre 201412 21 nov. 2002 à 09:27
'sorti de l'API guide (fonctionne)
'This project needs 2 pictureboxes
'Picturebox1 must contain a picture with a lot of white pixels (we're going to use white as transparent color)
Private Declare Function TransparentBlt Lib "msimg32.dll" (ByVal hdc 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 nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal crTransparent As Long) As Boolean
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/ 'E-Mail: KPDTeam@Allapi.net
Picture1.AutoSize = True
'API uses pixels
Picture1.ScaleMode = vbPixels
Picture2.ScaleMode = vbPixels
End Sub
Private Sub Picture2_Paint()
'If we don't call DoEvents first, our transparent image will be completely wrong
DoEvents
TransparentBlt Picture2.hdc, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, Picture1.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, vbWhite
End Sub