crossplatform relpath

This commit is contained in:
Lincoln-LM 2022-01-05 13:19:00 -07:00
parent 46e9e24680
commit 25fbd14bfa
7 changed files with 27 additions and 6 deletions

View File

@ -1,7 +1,7 @@
{
"MonitorWindow": 0,
"WindowPrefix": "",
"image": "images\\iphone\\eye.png",
"image": "./images/phone/eye.png",
"view": [
280,
375,

View File

@ -1,7 +1,7 @@
{
"MonitorWindow": 1,
"WindowPrefix": "LM-Q",
"image": "images\\phone\\eye.png",
"image": "images/phone/eye.png",
"view": [
217,
102,

View File

@ -1,7 +1,7 @@
{
"MonitorWindow": true,
"WindowPrefix": "LM-Q",
"image": "images\\phone\\eye.png",
"image": "images/phone/eye.png",
"view": [
217,
102,

View File

@ -1,7 +1,7 @@
{
"MonitorWindow": true,
"WindowPrefix": "SysDVR-Client [PID ",
"image": "images\\regis\\eye.png",
"image": "images/regis/eye.png",
"view": [
615,
507,

View File

@ -1,7 +1,7 @@
{
"MonitorWindow": true,
"WindowPrefix": "SysDVR-Client [PID ",
"image": "images\\home\\eye.png",
"image": "images/home/eye.png",
"view": [
610,
415,

View File

@ -0,0 +1,21 @@
{
"MonitorWindow": 1,
"WindowPrefix": "SysDVR-Client [PID ",
"image": "./images/spear_pillar/eye.png",
"view": [
621,
343,
17,
19
],
"thresh": 0.75,
"white_delay": 2.0,
"advance_delay": 2,
"crop": [
0,
0,
0,
0
],
"camera": 0
}

View File

@ -165,7 +165,7 @@ class Application(tk.Frame):
self.config_combobox_onchange()
def new_eye(self):
self.config_json["image"] = os.path.relpath(fd.askopenfilename(initialdir="./images/", filetypes=[("Image", ".png")]))
self.config_json["image"] = "./"+os.path.relpath(fd.askopenfilename(initialdir="./images/", filetypes=[("Image", ".png")])).replace("\\","/")
self.player_eye = cv2.imread(self.config_json["image"], cv2.IMREAD_GRAYSCALE)
self.player_eye_tk = self.cv_image_to_tk(self.player_eye)
self.eye_display['image'] = self.player_eye_tk