スキップしてメイン コンテンツに移動

投稿

ラベル(capture)が付いた投稿を表示しています

Java: Capture Web Page

Recently I was investigating how to capture web page as image. I recently realized that there is a nicer nice component for navigating web page in Java FX. javafx.scene.web.WebView javafx.embed.swing.JFXPanel I referred this stackoverflow post and wrote a Java class for capturing web page and save it as image. Please note that you should include jfxrt.jar, which was in JDK1.7.0_XX/jre/lib, should be added to your classpath. Code Here is an actual code. Please feel free to use it... I am very happy if you give me some feedback for this code. package com.dukesoftware.javafx; import static com.dukesoftware.utils.io.IOUtils.getExtension; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.Map; import java.util.Set; import java.util.concurrent.Executors; import java.util.concurrent.LinkedBlockingQueue; import javafx.application.Platform; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue;

ActionScript 3.0: Capture Web Page Image

In my recent post, I was trying to find out easy way to capture we page image. Today, I will show you my small code tip for capturing web page and saving it as image by ActionScript 3.0. WebPageCapture class This is the main class for capturing web page and save it as image. A few points I should comment... In captureAndSave method, I have used timer because even after Complete event is triggered, somehow sometimes web page is not rendered properly... (might be depends on web site or lazy javascript loading.) requstQueue field is for making sure the request is processed one by one after the former image capturing request is done. You can avoid this if you create HTMLLoader instance for each request. Looks default JPEGEncoder is quite slow.... I have googled and found the following great article. If you are interested in performance, see this excellent post . I was amazed actually :D If you are interested in asynchronous encoding, see this marvelous post . I was impressed :D