Hi everyone,
I recently tried creating a derma panel with an image that I create through render.Capture, but I seem to have trouble getting the image from the data folder (which render.Capture puts) into a derma panel.
Here's what I got:
hook.Add("PostRender", "renderCapture", function()
local x, y = (ScrW() / 2) - 170, (ScrH() / 2) - 250
local w, h = 499, 482
local data = render.Capture({
format = "jpeg",
quality = 30,
h = h - 35,
w = w - 35,
x = x,
y = y,
})
local f = file.Open( "Image.jpg", "wb", "DATA" )
util.Compress(data)
f:Write(data)
f:Close()
net.Start("image")
net.WriteString(data)
net.SendToServer()
end)
If I'm correct you have to split the string (net.Message) in multiple parts as it's too big.
render.Capture returns binary data, not base64 automatically. You'll need to pass it through that function first. (and yeah, you may need to split it into multiple strings)
Also, unless you're redirecting it to other players and you didn't show it, you're sending it all to the server. You can't create dermas on server, they're clientside functions.
Sorry, you need to Log In to post a reply to this thread.