N3xT Posted August 1, 2016 Share Posted August 1, 2016 Hello , I hope you're fine. Today, I have a question . How to draw a gif image ? Waiting for replies. Link to comment
Wumbaloo Posted August 1, 2016 Share Posted August 1, 2016 dxDrawGifImage https://wiki.multitheftauto.com/wiki/DxDrawGifImage Link to comment
N3xT Posted August 1, 2016 Author Share Posted August 1, 2016 Thanks but I have a little question Now I have a gif image need to convert it to (PNG,JPG) or not?. I try that but it doesn't work function dxDrawGifImage ( x, y, w, h, path, iStart, iType, effectSpeed ) local gifElement = createElement ( "dx-gif" ) if ( gifElement ) then setElementData ( gifElement, "gifData", { x = x, y = y, w = w, h = h, imgPath = path, startID = iStart, imgID = iStart, imgType = iType, speed = effectSpeed, tick = getTickCount ( ) }, false ) return gifElement else return false end end addEventHandler ( "onClientRender", root, function ( ) local currentTick = getTickCount ( ) for index, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do local gifData = getElementData ( gif, "gifData" ) if ( gifData ) then if ( currentTick - gifData.tick >= gifData.speed ) then gifData.tick = currentTick gifData.imgID = ( gifData.imgID + 1 ) if ( fileExists ( gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) ) then gifData.imgID = gifData.imgID setElementData ( gif, "gifData", gifData, false ) else gifData.imgID = gifData.startID setElementData ( gif, "gifData", gifData, false ) end end dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) end end end ) dxDrawGifImage ( 769, 175, 193, 145, "file/load", 0, "gif", 120 ) Debug say : Error loading image @ 'dxDrawImage' [file/load0.gif] at line 44 Link to comment
Captain Cody Posted August 2, 2016 Share Posted August 2, 2016 Yes you have to convert it. Link to comment
N3xT Posted August 2, 2016 Author Share Posted August 2, 2016 Yes you have to convert it. same error, I used format factory to convert it that is right ? Link to comment
Captain Cody Posted August 2, 2016 Share Posted August 2, 2016 Make sure the image is defined right and what not. Link to comment
N3xT Posted August 2, 2016 Author Share Posted August 2, 2016 Make sure the image is defined right and what not. I convert my gif image to png, but it doesn't work after converting the image to png, it looks confused there is another way to convert it ? Link to comment
N3xT Posted August 2, 2016 Author Share Posted August 2, 2016 Thanks all, the problem was in argument 6, you need to change it to 1 Link to comment
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