#Viniih Posted December 4, 2018 Share Posted December 4, 2018 (IF POSSIBLE / SE FOR POSSÍVEL) How do I use an internet img in the dxDrawImage function? Como faço para usar uma img da internet na função dxDrawImage? Example: local link = "https://media.rockstargames.com/rockstargames-newsite/img/global/downloads/buddyiconsconavatars/sanandreas_truth_256x256.jpg" function teste() dxDrawImage(0, 0, 256, 256, link, 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEventHandler("onClientRender", root, teste) Link to comment
Tails Posted December 4, 2018 Share Posted December 4, 2018 not supported, however you can do this... local link = "https://media.rockstargames.com/rockstargames-newsite/img/global/downloads/buddyiconsconavatars/sanandreas_truth_256x256.jpg" local pix requestBrowserDomains({link}, true, function(accepted) if not accepted then return end fetchRemote(link, function(data, err) if err > 0 then error('Error: ', err) end pix = dxCreateTexture(data) end) end) function teste() if pix then dxDrawImage(0, 0, 256, 256, pix, 0, 0, 0, tocolor(255, 255, 255, 255), false) end end addEventHandler("onClientRender", root, teste) I didn't test it but it should work 1 Link to comment
#Viniih Posted December 5, 2018 Author Share Posted December 5, 2018 It worked! Now another doubt, to take the facebook photo of the player to use as avatar using the above function? English by Google translator 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