Would there be an option in the :CaptureScreenshot() function to crop the resultant screenshot? I’m trying to make a Kodak-style camera tool, but unfortunately it always has the aspect ratio of the players screen, rather than the classic 1:1 ratio.
If there was an option to crop the screenshots, it would allow more possibilities for more immersive photo-taking, and more interesting photos for players to share.
if you do not need to modify the image, you can only use an ImageLabel
CaptureService:CaptureScreenshot(function(id)
local NewImageLabel = Instance.new("ImageLabel")
NewImageLabel.Image = id
NewImageLabel.Parent = <insert parent>
end)
if you want to modify the image with EditableImage:
CaptureService:CaptureScreenshot(function(id)
local NewScreenshot = AssetService:CreateEditableImageAsync(id) -- returns EditableImage, see https://create.roblox.com/docs/reference/engine/classes/EditableImage for more details
-- resize image to 512x512, for example
NewScreenshot:Resize(512,512)
-- create ImageLabel to preview changes
local NewImageLabel = Instance.new("ImageLabel")
NewScreenshot.Parent = NewImageLabel
NewImageLabel.Parent = <insert parent>
end)
Have you guys considered letting us publish these image assets, via a plugin? i.e: If I wanted to make a plugin that automatically generates a bunch of icons and then saves them, for use in game.
I would love to be able to publish these temporary images so that they become permanent. I’m working on a document system where researchers upload their own documents, it would be great if they could also include images in them for proof.
Better yet - is support for actual shaders and postfx on the horizon? It would be much more performant than taking a screenshot every frame with CaptureService and doing expensive CPU math on it.
Experimented around further and it appears that when these properties are enabled, the CoreGui is physically disabled during a player-activated capture, very possible that this was done due to a combination of security-reasons as well as technical-limitations. Hope that this changes in the future, however.
I really love the new API, however, I am concerned about its potential for misuse in collecting data without user consent or awareness.
Whilst playing around with the API I have noticed the absence of a prompt triggered by the :CaptureScreenshot() method, making it possible for developers to take screenshots of a user’s ROBLOX session without detection. This lack of notification could enable undectable data collection on all users on roblox.
Delving further, I approached the API from a more malicious standpoint and discovered a method to seamlessly export taken screenshots from ROBLOX to my web server in real-time. Subsequently, I could recreate the image or even generate a video of the ROBLOX session without the user’s knowledge. This recording process operates without any prompts or noticeable screen lag, leaving the targeted user unaware of their session being surveilled.
The scary thing is that it’s not that hard to pull off.
Capture the screenshot with the :CaptureScreenshot()-method of the CaptureService.
Use the id to create an EditableImage-Instance using the :CreateEditableImageAsync()-method of the AssetService.
Send the EditableImage-Instance to a ServerScript via RemoteEvent.
Partition the screenshot into chunks using the :ReadPixels()-method of the created EditableImage-Instance.
Remove unnecessary image-data. There is no need to keep the alpha-values for the pixels given by the :ReadPixels()-method as for the screenshot they are always 0. (this makes the end-size of the image 25% smaller).
Send the chunk to your web server using the HTTP Service.
On the webserver, read the data and convert it to any image or video format.
It should be mentioned that this only works for sessions created in ROBLOX Studio as the EditableImage is not yet realeased for the ROBLOX Client.
A simple way to counter this misuse is by adding a prompt to the :CaptureScreenshot()-method when invoked. I do understand that without the prompt developers could use the Service for exploit-protection systems but the possiblity that other malicious developers could gather data of minors without their (parent’s) concent or knowledge is more serious.