diff horori/merger/src/utils.cpp @ 0:aaaa401818a1 draft

first commit.
author pyon <pyon@macmini>
date Mon, 24 May 2021 21:32:58 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/horori/merger/src/utils.cpp	Mon May 24 21:32:58 2021 +0900
@@ -0,0 +1,28 @@
+// Filename   : utils.cpp
+// Last Change: 2020-03-18  15:01:12.
+//
+#include <wx/wx.h>
+#include "utils.h"
+
+wxRect Geo2Rect(wxString geo)
+{
+    long w, h, x, y;
+    wxString sw = geo.BeforeFirst('x');
+    wxString sh = geo.AfterFirst('x').BeforeFirst('+');
+    wxString sx = geo.AfterFirst('+').BeforeFirst('+');
+    wxString sy = geo.AfterLast('+');
+
+    sw.ToLong(&w, 10);
+    sh.ToLong(&h, 10);
+    sx.ToLong(&x, 10);
+    sy.ToLong(&y, 10);
+
+    return wxRect((int)x, (int)y, (int)w, (int)h);
+}
+
+wxRect ZeroRect()
+{
+	wxRect rect(wxPoint(0, 0), wxPoint(0, 0));
+	return rect;
+}
+