summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaeyoung Son <taeyoung2.son@samsung.com>2013-09-25 22:10:21 +0900
committerTaeyoung Son <taeyoung2.son@samsung.com>2013-09-26 14:19:40 +0900
commitcc4c292c1cb44836fef0177b5ec5703b3b10251d (patch)
treeb2d8f1d25b44ccdd7f77c1eb6d88809ed1e96578
parent805bfc9cab82e25ef25e68a8f2bf071eafbf0550 (diff)
downloadcommon-eplugin-cc4c292c1cb44836fef0177b5ec5703b3b10251d.tar.gz
common-eplugin-cc4c292c1cb44836fef0177b5ec5703b3b10251d.tar.bz2
common-eplugin-cc4c292c1cb44836fef0177b5ec5703b3b10251d.zip
[Title] Modify live editing app's icon
[Desc.] [Issue] Change-Id: I288ba317b5fd8df2f9480a40f69a2182ef7d0261
-rw-r--r--org.tizen.common/src/org/tizen/common/util/ImageUtil.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/org.tizen.common/src/org/tizen/common/util/ImageUtil.java b/org.tizen.common/src/org/tizen/common/util/ImageUtil.java
index 0c7d7f762..5395ba18b 100644
--- a/org.tizen.common/src/org/tizen/common/util/ImageUtil.java
+++ b/org.tizen.common/src/org/tizen/common/util/ImageUtil.java
@@ -25,6 +25,8 @@
package org.tizen.common.util;
import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Point;
import java.awt.image.BufferedImage;
import java.awt.image.DirectColorModel;
import java.awt.image.IndexColorModel;
@@ -282,4 +284,44 @@ public class ImageUtil {
return null;
}
+ /**
+ * stack up two image files and combine into one.
+ * @param bottom bottom image
+ * @param bottomPoint the spot where the bottome image will be placed
+ * @param top top image
+ * @param topPoint the spot where the top image will be placed
+ * @param width width of the created image
+ * @param height height of the created image
+ * @param imgType type of the created image
+ * @return combined image
+ */
+ public static BufferedImage pileUp(BufferedImage bottom, Point bottomPoint,
+ BufferedImage top, Point topPoint,
+ int width, int height,
+ int imgType) {
+
+ BufferedImage img = new BufferedImage(width, height, imgType);
+ boolean result = false;
+ Graphics2D g = null;
+
+ try {
+ g = img.createGraphics();
+
+ result = g.drawImage(bottom, (int)bottomPoint.getX(), (int)bottomPoint.getY(), null);
+ if (!result) {
+ return null;
+ }
+
+ result = g.drawImage(top, (int)topPoint.getX(), (int)topPoint.getY(), null);
+ if (!result) {
+ return null;
+ }
+ } finally {
+ if (g != null) {
+ g.dispose();
+ }
+ }
+
+ return img;
+ }
}