summaryrefslogtreecommitdiff
path: root/NET/worlds/console/ScapePicCanvas.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/console/ScapePicCanvas.java
downloadworlds.jar-main.tar.xz
worlds.jar-main.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/console/ScapePicCanvas.java')
-rw-r--r--NET/worlds/console/ScapePicCanvas.java87
1 files changed, 87 insertions, 0 deletions
diff --git a/NET/worlds/console/ScapePicCanvas.java b/NET/worlds/console/ScapePicCanvas.java
new file mode 100644
index 0000000..74da0ee
--- /dev/null
+++ b/NET/worlds/console/ScapePicCanvas.java
@@ -0,0 +1,87 @@
+/* */ package NET.worlds.console;
+/* */
+/* */ import java.awt.Canvas;
+/* */ import java.awt.Container;
+/* */ import java.awt.Dimension;
+/* */ import java.awt.Frame;
+/* */ import java.awt.Point;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class ScapePicCanvas
+/* */ extends Canvas
+/* */ {
+/* */ private static final long serialVersionUID = 927951584800056826L;
+/* */ private int hWnd;
+/* */
+/* */ public void drawScapePicImage(ScapePicImage image, int xDst, int yDst, int xSrc, int ySrc, int width, int height)
+/* */ {
+/* 48 */ if (this.hWnd == 0) {
+/* 49 */ Point loc = locationInWindow();
+/* 50 */ Dimension size = getSize();
+/* 51 */ String title = getFrameTitle();
+/* 52 */ assert (title != null);
+/* 53 */ int hWndParent = Window.findWindow(title);
+/* 54 */ assert (hWndParent != 0);
+/* 55 */ this.hWnd = Window.findChildWindow(hWndParent, loc.x, loc.y, size.width,
+/* 56 */ size.height);
+/* 57 */ assert (this.hWnd != 0);
+/* */ }
+/* 59 */ bitBlt(this.hWnd, image.getDIB(), xDst, yDst, xSrc, ySrc, width, height);
+/* */ }
+/* */
+/* */ private String getFrameTitle()
+/* */ {
+/* 64 */ for (Container c = getParent(); c != null; c = c.getParent())
+/* 65 */ if ((c instanceof Frame))
+/* 66 */ return ((Frame)c).getTitle();
+/* 67 */ return null;
+/* */ }
+/* */
+/* */ private Point locationInWindow()
+/* */ {
+/* 72 */ Point offset = getLocation();
+/* 73 */ for (Container c = getParent(); c != null; c = c.getParent()) {
+/* 74 */ Point move = c.getLocation();
+/* 75 */ offset.translate(move.x, move.y);
+/* */ }
+/* 77 */ return offset;
+/* */ }
+/* */
+/* */ public static native void bitBlt(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8);
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\ScapePicCanvas.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file