Screen Capture / Saving CSS3 to image somehow? - ruby-on-rails

I have a div that's 512x512 and the user can drag/drop stuff around.
I would like to save this for use in an email which doesn't support many CSS properties.
My initial idea was to take a screenshot and crop it but I can't seem to find a good way of doing this.

I figured out how to do this and wrote a blog post on it here - http://jbeas.com/ruby-on-rails/rails-screenshot-pdf-gem/

Related

Best and easiest way to directly render CGPDFPage

I am looking for an easy, direct and straightforward way to render a CGPDFPage and view it on an iOS device.
The rendered page should fill the view to which it is drawn and be crispy clear.
The less the code used in the method the better. However, if the amount of code required for the best result is too much, then it is preferred that the code be organised and well written.
Please do include a way to view in RGB color instead of CMYK.
I'd really appreciate it if you didn't suggest PDF readers/viewers or Github projects since I prefer not using them.
Thanks in advance.
I don't think this is a valid question. Anyways you should take a look to apple sample codes first.
Here you go
https://developer.apple.com/library/ios/samplecode/ZoomingPDFViewer/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010281

Jquery-Mobile taphold specific area on image

I have an image and I want to make taphold events for specific areas of the image. The image scales to 100% width of the page.
Is there any possible way in Jquery-Mobile to to get this done? I've been looking everywhere and can't seem to find a way of getting around this.
Thank you in advance
Got to use image mapping to solve this problem.

Obtain iOS7-like blur effect with Qt

I was asking myself how I could obtain an iOS 7 like blur/transparency effect. Something like this:
(source: ilounge.com)
I'd like to apply this to a whole QDialog. I know how to obtain a nice transparency, but not how to get this blur.
Can someone help?
Thanks a lot!
Basically, you need to first get a screenshot of the desktop. Then you need to blur it. Then probably save the image to the harddrive. Then you need to set it as the background for your dialog.
And then you need to make the background for each button transparent, too.
If you use QGraphicsView or OpenGL, the last three steps may be very different.
http://qt-project.org/doc/qt-5.0/qtgui/qscreen.html#grabWindow
http://qt-project.org/doc/qt-5.0/qtwidgets/desktop-screenshot.html
Lines of code where it actually grabs the screen:
QScreen *screen = QGuiApplication::primaryScreen();
if (screen)
originalPixmap = screen->grabWindow(0);
In Qt 4.8, it used to be done this way:
http://qt-project.org/doc/qt-5.0/qtgui/qpixmap.html#grabWindow
To blur the screenshot, use this:
http://doc-snapshot.qt-project.org/4.8/qgraphicsblureffect.html
You may need to save it to the harddrive for QStylesheets to be able to find it.
To set the background image, try something like this:
http://qt-project.org/doc/qt-5.0/qtwidgets/stylesheet-reference.html#background-image-prop
Example of how to set a stylesheet:
qApp->setStyleSheet("QLineEdit { background-color: yellow }");
http://qt-project.org/doc/qt-4.8/stylesheet-examples.html
http://qt-project.org/forums/viewthread/1397
Hope that helps.
Thanks a lot for your help phyatt, I succeeded. Although my code works, the result is not as pretty as iOS':
iOS7-like blur with Qt
however, I'm going to post the whole code on my website, I'll post the link here in a while.
Stay tuned!
[EDIT] here's the link to the detailed how-to: iOS7 like blur effect with QT

Rendering a Rails partial to an image

So, I have a problem and my initial question is: Is this possible?
I'm allowing people to customize the appearance of something using css, and then once they save it I want to turn it into thumbnails to use to display it in various other places (in other sizes maintaining that same aspect ratio).
So the question is, is it possible to do something where I render that partial, then it's saved to an image that I can upload to aws in various sizes etc. using paperclip? Once I get the image I can do the paperclip part, but it's getting that partial to render the html/css and save that to an image... Thoughts?
Just know, any help and/or thoughts at all would be great!
Thanks,
Mike
This might help you:
rails convert html to image

Image Crop component

I need a simple component to do image crop, to use inside an option where user must select an image, photo, or logo to represent them.
I already done some search with Google but found nothing good.
I would something with source code.
A TRect, DrawFocusRect and some handling of OnMouseDown, OnMouseMove, OnMouseUp for allowing user interaction to draw the cropping frame
and
BitBlt to do the actual cropping after the user is happy with the selection he made.
And look, there is an example which uses those same ideas: http://exampledelphi.com/delphi.php/tips-and-tricks/crop-image-with-drag-the-mouse/.
God bless!
Try ImageEn from http://www.hicomponents.com/main/. It does what you want and a lot more. It is free, but not sure if you can get source with it.

Resources