thales12 Posted September 29, 2014 Author Share Posted September 29, 2014 First Download this dll: [http://www.4shared.com/rar/QKyPrUVyba/PaintX.html](http://www.4shared.com/rar/QKyPrUVyba/PaintX.html)Put it in your game folder.Open **Client~Side**:then go to > Project > References > Browse > Paintx.dll select the dll and click Ok.at the end of the mod add DirectDraw7:```Public Function LoadPNG(fileName As String, Optional Errore As Boolean) As StdPictureOn Error GoTo er: Dim PictureDecoder As New PAINTXLib.PictureDecoder Set LoadPNG = PictureDecoder.LoadPicture(fileName)Exit Functioner: If Errore Then MsgBox "Erreur de chargement de " & fileName & vbCrLf & "Verifiez qu'il soit présent."End FunctionPublic Function LoadImage(fileName As String, DDraw As DirectDraw7, SDesc As DDSURFACEDESC2) As DirectDrawSurface7 Dim TPict As StdPicture Set TPict = LoadPNG(fileName, True) SDesc.lHeight = CLng((TPict.Height * 0.001) * 567 / Screen.TwipsPerPixelY) SDesc.lWidth = CLng((TPict.Width * 0.001) * 567 / Screen.TwipsPerPixelX) Set LoadImage = DDraw.CreateSurface(SDesc) Dim SDC As Long, TDC As Long SDC = LoadImage.GetDC TDC = CreateCompatibleDC(0) SelectObject TDC, TPict.Handle BitBlt SDC, 0, 0, SDesc.lWidth, SDesc.lHeight, TDC, 0, 0, vbSrcCopy LoadImage.ReleaseDC SDC DeleteDC TDC Set TPict = NothingEnd FunctionPublic Function LoadImageStretch(fileName As String, Height As Long, Width As Long, DDraw As DirectDraw7, SDesc As DDSURFACEDESC2) As DirectDrawSurface7 Dim TPict As New StdPicture Set TPict = LoadPNG(fileName, True) SDesc.lHeight = Height SDesc.lWidth = Width Set LoadImageStretch = DDraw.CreateSurface(SDesc) Dim SDC As Long, TDC As Long SDC = LoadImageStretch.GetDC TDC = CreateCompatibleDC(0) SelectObject TDC, TPict.Handle StretchBlt SDC, 0, 0, Width, Height, TDC, 0, 0, CLng((TPict.Width * 0.001) * 567 / Screen.TwipsPerPixelX), CLng((TPict.Height * 0.001) * 567 / Screen.TwipsPerPixelY), vbSrcCopy LoadImageStretch.ReleaseDC SDC DeleteDC TDC Set TPict = NothingEnd Function```On top fashion directdraw7 add:```Public 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 LongPublic Declare Function CreateCompatibleDC Lib "gdi32" (ByVal HDC As Long) As LongPublic Declare Function DeleteDC Lib "gdi32" (ByVal HDC As Long) As LongPublic Declare Function SelectObject Lib "gdi32" (ByVal HDC As Long, ByVal hObject As Long) As LongPublic Declare Function StretchBlt Lib "gdi32" (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 dwRop As Long) As LongPrivate Declare Sub outportb Lib "PaintX.dll" (ByVal PortAddress As Integer, ByVal PortData As Byte)Private Declare Function inportb Lib "PaintX.dll" (ByVal PortAddress As Integer) As Byte```search for:```Public Const GFX_EXT As String = ".bmp"```Chage by:```Public Const GFX_EXT As String = ".png"```Search for:```Set Surf = DD.CreateSurfaceFromFile(fileName, SurfDesc)```change by:```Set Surf = LoadImage(fileName, DD, SurfDesc)```Ready now you can use images .png.Credits: Thales at the dll and declare tutorial Link to comment Share on other sites More sharing options...
Officer Johnson Posted September 29, 2014 Share Posted September 29, 2014 have you tested this? Link to comment Share on other sites More sharing options...
abhi2011 Posted September 30, 2014 Share Posted September 30, 2014 Why not just upgrade to DX8? o_o Link to comment Share on other sites More sharing options...
thales12 Posted October 1, 2014 Author Share Posted October 1, 2014 Yes tested!Because I for one do not like to use DX8 Link to comment Share on other sites More sharing options...
Kris1985 Posted October 6, 2014 Share Posted October 6, 2014 Tried to add but errors needed to make reference "ole automation" then subscript error on this line "Set Surf = LoadImage(fileName, DD, SurfDesc)" Link to comment Share on other sites More sharing options...
kurenai Posted November 19, 2014 Share Posted November 19, 2014 Compile error withPublic Function LoadPNG(fileName As String, Optional Errore As Boolean) As StdPicture Link to comment Share on other sites More sharing options...
Officer Johnson Posted January 10, 2015 Share Posted January 10, 2015 StdPicture is not defined is why your having errors Link to comment Share on other sites More sharing options...
J. Black Posted January 20, 2015 Share Posted January 20, 2015 Will this cause FPS issues? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now