Archive for the ‘Codes’ Category

Video Capturing In Java Using JMF

February 7th, 2010

Hello Everyone,

I’m back with something new, while exploring Java and this time the API is : Java Media Framework (JMF).

Well this time I’m going to share how you can create Video Capturing Application Or you can say a Webcam in Java using JMF API.

Here’s a cap :
Cap Of Video Capturing Application Created In Java

No more words and without wasting more time. Lets get to the main point.

Here’s the code :  Click Here
Comments on all main lines of code are provided in file.

More to come soon!..

Image processing in PHP

September 29th, 2009

Hello All,

Here’s a simple PHP code to convert an image into Black and White Or Negative Or any other color combination.

Demo :
Demo_Image

Click here to see the code

Enjoy!

Screen Shot Using Java

June 29th, 2009

Hello all,

I’m back ! Hope you all enjoyed Christmas. Today, I will tell you how to take screen shot and save it as .jpg, .png, .gif ( and so on ) file using java program.

Rectangle rectangle = new Rectangle(x, y, width, height);
// x = pixel from left
// y = pixel from top
// width = image width
// height = image height

Robot robot = new Robot();
BufferedImage image = robot.createScreenCapture(rectangle);
// Creates an image containing pixels read from the screen. This image does not include the mouse cursor and return BufferedImage object.

File file = new File(”screenshot.png”);
ImageIO.write(image, “png”, file);
// A class containing static convenience methods for locating ImageReaders and ImageWriters, and performing simple encoding and decoding.

//The code above will take screenshot according to rectangle object and it will save screenshot.png file in same folder where your java file is located.

//You can use Toolkit.getDefaultToolkit().getScreenSize() to take complete screenshot.

Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
Rectangle rectangle = new Rectangle(0, 0, size.width, size.height);

Its done! :D

 # Links  # Categories  # Connect With Me