Capturing image from webcam in java?

This JavaCV implementation works fine. Code: import org.bytedeco.javacv.*; import org.bytedeco.opencv.opencv_core.IplImage; import java.io.File; import static org.bytedeco.opencv.global.opencv_core.cvFlip; import static org.bytedeco.opencv.helper.opencv_imgcodecs.cvSaveImage; public class Test implements Runnable { final int INTERVAL = 100;///you may use interval CanvasFrame canvas = new CanvasFrame(“Web Cam”); public Test() { canvas.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); } public void run() { new File(“images”).mkdir(); FrameGrabber grabber = new OpenCVFrameGrabber(0); // … Read more

CSS: create white glow around image

Use simple CSS3 (not supported in IE<9) img { box-shadow: 0px 0px 5px #fff; } This will put a white glow around every image in your document, use more specific selectors to choose which images you’d like the glow around. You can change the color of course 🙂 If you’re worried about the users that … Read more

Can I get image from canvas element and use it in img src tag?

canvas.toDataURL() will provide you a data url which can be used as source: var image = new Image(); image.id = “pic”; image.src = canvas.toDataURL(); document.getElementById(‘image_for_crop’).appendChild(image); Complete example Here’s a complete example with some random lines. The black-bordered image is generated on a <canvas>, whereas the blue-bordered image is a copy in a <img>, filled with … Read more

CSS image max-width set to original image size?

Just don’t set the width of the image, only the max-width. img {max-width:100%; height:auto} (height:auto is not really necessary, since auto is the default, but I put it in there as a reminder to myself that I want the image to have its natural proportions.) This snippet has two boxes, one that is smaller than … Read more

Uploading/Displaying Images in MVC 4

Have a look at the following @using (Html.BeginForm(“FileUpload”, “Home”, FormMethod.Post, new { enctype = “multipart/form-data” })) { <label for=”file”>Upload Image:</label> <input type=”file” name=”file” id=”file” style=”width: 100%;” /> <input type=”submit” value=”Upload” class=”submit” /> } your controller should have action method which would accept HttpPostedFileBase; public ActionResult FileUpload(HttpPostedFileBase file) { if (file != null) { string pic … Read more

Rotate an image in image source in html

If your rotation angles are fairly uniform, you can use CSS: <img id=”image_canv” src=”https://stackoverflow.com/image.png” class=”rotate90″> CSS: .rotate90 { -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); } Otherwise, you can do this by setting a data attribute in your HTML, then using Javascript to add the necessary styling: <img id=”image_canv” src=”https://stackoverflow.com/image.png” data-rotate=”90″> Sample … Read more

Converting a PDF to PNG

You can use one commandline with two commands (gs, convert) connected through a pipe, if the first command can write its output to stdout, and if the second one can read its input from stdin. Luckily, gs can write to stdout (… -o %stdout …). Luckily, convert can read from stdin (convert -background transparent – … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)