Jump to content

HTML image from link


Piorun

Recommended Posts

Hi guys,

I read that i can't load remote content for my local website but is there any solution to make this possible? For ex. i want to get gravatar from link

[url=https://s.gravatar.com/avatar/0cb95b1047a5e33381d7cda457e57b51?s=80]https://s.gravatar.com/avatar/0cb95b104 ... 57b51?s=80[/url] 

Meybe it is possible through Lua? I mean

fetchRemote 

Pls answer :)

Link to comment

You don't need to write JS code.

Here's an example:

local image_data 
fetchRemote('https://s.gravatar.com/avatar/0cb95b1047a5e33381d7cda457e57b51?s=80', function(err, data) 
 if (err) then print(err) return end 
 img_data = data 
end) 
  
addEventHandler('onPlayerJoin', root, function() 
 triggerLatentClientEvent(source, 'downloadImage', resourceRoot, img_data) 
end) 

On the client, receive the image_data, create a texture and draw it.

local image = dxCreateTexture(img_data) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...