-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've implemented a screenshot function of NSView, UIView and GLKView. #230
base: master
Are you sure you want to change the base?
Conversation
@MichaelBuckley can I get your opinion on this pull request since it's in your OS X world? |
@moredip This is not really OS X related - GLKView is an iOS class. I am pretty sure the code is working although some of the (I don't understand the need for sending base-64-encoded images back to ruby). |
@moredip I left a comment, but it otherwise looks good. |
Oh yeah, I agree with @ondrejhanslik. The category methods should be prefixed. |
Yes, I'm a bit confused as to what the need is for the base64-encoded image. @suzumura-ss, can you explain? I think it'd make more sense to separate out the GLKView support from the base64 stuff. |
The reason I was Base64-encoded, I did not know how to generate a JSON object with PNG-binary in If GLKView support is extensible to And, I agree that to put a prefix. |
Also, instead of checking the availability of method
I still don't like the Base-64 encoding. Maybe we could use the implementation that is already present in the "screenshot/snapshot-all-views" => will capture all the views def get_view_screenshot(view_selector)
frank_server.send_get("screenshot/snapshot-all-views")
view_uids = frankly_map(view_selector, "FEX_UID")
screenshots = Array.new
view_uids.each do |uid|
path = "screenshot/view-snapshot/#{uid}"
image_data = frank_server.send_get( path )
screenshots.push(image_data)
end
screenshots
end This supposes adding a method What do you think? |
Why did not the category of GLKView call I also thought the idea to get UID. |
IIRC the snapshotAllViews method manages its own garbage - it clears out any old snapshots before it saves the new ones. Cheers, PeteTyped on a little bitty keyboard On Jul 3, 2013, at 5:00 AM, Toshiyuki Suzumura [email protected] wrote:
|
I made sure the matter of garbage. It was cleared. I tried to implement |
Hi there.
I've implemented a screenshot function of NSView, UIView and GLKView.
NSOpenGLView does not support.
UIView#-(UIImage*)captureImage
, make the image using theGLKView#-(UIImage*)snapshot
method in the case of GLKView.-(NSString*)captureBase64PngImage
method to NSView and UIView. To FrankHelper, this sends a PNG image with the Base64 encoding.FrankHelper#capture(selector)
returns to the test code with Base64 decode this data.