diff --git a/dist/视频添加二维码.exe b/dist/视频添加二维码.exe index adb2ab3..55aba2b 100644 Binary files a/dist/视频添加二维码.exe and b/dist/视频添加二维码.exe differ diff --git a/dlg/qrcode.aardio b/dlg/qrcode.aardio index a0cfda4..8c7be11 100644 --- a/dlg/qrcode.aardio +++ b/dlg/qrcode.aardio @@ -1,8 +1,9 @@ import win.ui; +import win.region.hole; /*DSG{{*/ -var winform = win.form(text="aardio form";right=304;bottom=297;bgcolor=16777215;border="none";exmode="none";max=false;min=false;mode="popup";sysmenu=false;title=false) +var winform = win.form(text="aardio form";right=304;bottom=297;border="none";exmode="none";mode="popup") winform.add( -plus={cls="plus";left=0;top=0;right=271;bottom=256;clipBk=false;dl=1;dt=1;repeat="scale";z=1} +plus={cls="plus";left=0;top=0;right=305;bottom=298;ah=1;aw=1;clipBk=false;db=1;dl=1;dr=1;dt=1;transparent=1;z=1} ) /*}}*/ @@ -36,8 +37,12 @@ winform.wndproc = function(hwnd, message, wParam, lParam) { } } -//winform.setPos(0,0, winform.parent.hwnd); +import win.ui.layered; +win.ui.layered(winform); + +import win.ui.simpleWindow; +main = win.ui.simpleWindow(winform,0,0,0); +win.ui.minmax(winform,50,50,500,500); + winform.show(); -//winform.transparent(128,0xFFFFFF) -//winform.transparent(true) win.loopMessage(); \ No newline at end of file diff --git a/dlg/test.aardio b/dlg/test.aardio index 5f94dec..1c2ddab 100644 --- a/dlg/test.aardio +++ b/dlg/test.aardio @@ -5,7 +5,7 @@ var winform = win.form(text="aardio form";right=759;bottom=469;composited=1;mode winform.add( button={cls="button";text="向上拖动";left=538;top=138;right=673;bottom=199;z=2}; button2={cls="button";text="向下拖动";left=539;top=239;right=674;bottom=300;z=3}; -plus={cls="plus";left=266;top=117;right=466;bottom=317;background="C:\Users\97975\Desktop\视频增加二维码\1_i2skbfmDsHayHhqPfwt6pA.png";border={color=-65536;width=3};clipBk=false;foreRepeat="stretch";notify=1;z=1} +plus={cls="plus";left=266;top=117;right=466;bottom=317;background="C:\Users\97975\Desktop\视频增加二维码\1_i2skbfmDsHayHhqPfwt6pA.png";border={color=-65536;width=3};clipBk=false;foreRepeat="stretch";foreground="C:\Users\97975\Desktop\视频增加二维码\1_i2skbfmDsHayHhqPfwt6pA.png";notify=1;z=1} ) /*}}*/ @@ -93,76 +93,78 @@ winform.plus.wndproc = function(hwnd, message, wParam, lParam){ } } else if (message == 0x200) { // WM_MOUSEMOVE if (isDragging) { + var deltaX = x - startX; + var deltaY = y - startY; if (dragType == "top") { - var deltaY = y - startY; winform.text = "Dragging top: deltaY=" + deltaY; // 处理上边框拖动 - if(startY == -1){ - winform.plus.top -= 1; + if (deltaY != 0) { + winform.plus.top += deltaY; + winform.plus.height -= deltaY; + startY = y; } - else { - winform.plus.top += 1; - } - startY = y; } else if (dragType == "bottom") { - var deltaY = y - startY; winform.text = "Dragging bottom: deltaY=" + deltaY; // 处理下边框拖动 - winform.plus.height = winform.plus.height + deltaY; - startY = y; + if (deltaY != 0) { + winform.plus.height += deltaY; + startY = y; + } } else if (dragType == "left") { - var deltaX = x - startX; winform.text = "Dragging left: deltaX=" + deltaX; // 处理左边框拖动 - winform.plus.left = winform.plus.left + deltaX; - winform.plus.width = winform.plus.width - deltaX; - startX = x; + if (deltaX != 0) { + winform.plus.left += deltaX; + winform.plus.width -= deltaX; + startX = x; + } } else if (dragType == "right") { - var deltaX = x - startX; winform.text = "Dragging right: deltaX=" + deltaX; // 处理右边框拖动 - winform.plus.width = winform.plus.width + deltaX; - startX = x; + if (deltaX != 0) { + winform.plus.width += deltaX; + startX = x; + } } else if (dragType == "top-left") { - var deltaX = x - startX; - var deltaY = y - startY; winform.text = "Dragging top-left: deltaX=" + deltaX + ", deltaY=" + deltaY; // 处理左上角拖动 - winform.plus.left = winform.plus.left + deltaX; - winform.plus.width = winform.plus.width - deltaX; - winform.plus.top = winform.plus.top + deltaY; - winform.plus.height = winform.plus.height - deltaY; - startX = x; - startY = y; + if (deltaX != 0 || deltaY != 0) { + winform.plus.left += deltaX; + winform.plus.width -= deltaX; + winform.plus.top += deltaY; + winform.plus.height -= deltaY; + startX = x; + startY = y; + } } else if (dragType == "top-right") { - var deltaX = x - startX; - var deltaY = y - startY; winform.text = "Dragging top-right: deltaX=" + deltaX + ", deltaY=" + deltaY; // 处理右上角拖动 - winform.plus.width = winform.plus.width + deltaX; - winform.plus.top = winform.plus.top + deltaY; - winform.plus.height = winform.plus.height - deltaY; - startX = x; - startY = y; + if (deltaX != 0 || deltaY != 0) { + winform.plus.width += deltaX; + winform.plus.top += deltaY; + winform.plus.height -= deltaY; + startX = x; + startY = y; + } } else if (dragType == "bottom-left") { - var deltaX = x - startX; - var deltaY = y - startY; winform.text = "Dragging bottom-left: deltaX=" + deltaX + ", deltaY=" + deltaY; // 处理左下角拖动 - winform.plus.left = winform.plus.left + deltaX; - winform.plus.width = winform.plus.width - deltaX; - winform.plus.height = winform.plus.height + deltaY; - startX = x; - startY = y; + if (deltaX != 0 || deltaY != 0) { + winform.plus.left += deltaX; + winform.plus.width -= deltaX; + winform.plus.height += deltaY; + startX = x; + startY = y; + } } else if (dragType == "bottom-right") { - var deltaX = x - startX; - var deltaY = y - startY; winform.text = "Dragging bottom-right: deltaX=" + deltaX + ", deltaY=" + deltaY; // 处理右下角拖动 - winform.plus.width = winform.plus.width + deltaX; - winform.plus.height = winform.plus.height + deltaY; - startX = x; - startY = y; + if (deltaX != 0 || deltaY != 0) { + winform.plus.width += deltaX; + winform.plus.height += deltaY; + startX = x; + startY = y; + } } } } else if (message == 0x202) { // WM_LBUTTONUP @@ -177,14 +179,15 @@ winform.plus.wndproc = function(hwnd, message, wParam, lParam){ } // 向上拖动,图片增高,上横线上移动 -winform.button.oncommand = function(id,event){ - //winform.plus.height += 1; - winform.plus.top -= 1; +winform.button.oncommand = function(id, event){ + winform.plus.top -= 1; } -winform.button2.oncommand = function(id,event){ - winform.plus.top += 1; +// 向下拖动,图片变矮,上横线下移动 +winform.button2.oncommand = function(id, event){ + winform.plus.top += 1; } - +winform.transparent(0) +winform.plus.orphanWindow(); winform.show(); win.loopMessage(); \ No newline at end of file diff --git a/main.aardio b/main.aardio index 61e4457..44382e1 100644 --- a/main.aardio +++ b/main.aardio @@ -4,9 +4,9 @@ mainForm = win.form(text="视频添加二维码";right=519;bottom=759;bgcolor=16 mainForm.add( custom={cls="custom";text="自定义控件";left=10;top=76;right=510;bottom=668;border=1;clip=1;db=1;dl=1;dr=1;dt=1;z=4}; edit={cls="edit";left=10;top=673;right=510;bottom=750;db=1;dl=1;dr=1;edge=1;multiline=1;readonly=1;z=5}; -plus={cls="plus";text="导入视频";left=63;top=28;right=162;bottom=58;bgcolor=-5197169;border={color=-16777216;radius=3;width=1};dl=0.12;dr=0.69;dt=1;font=LOGFONT(h=-13);forecolor=16777215;z=1}; -plus2={cls="plus";text="导入二维码";left=179;top=28;right=278;bottom=58;bgcolor=-5197169;border={color=-16777216;radius=3;width=1};dl=0.34;dr=0.47;dt=1;font=LOGFONT(h=-13);forecolor=16777215;notify=1;z=2}; -plus3={cls="plus";text="保存格式";left=337;top=28;right=436;bottom=58;bgcolor=-5197169;border={color=-16777216;radius=3;width=1};dl=0.65;dr=0.16;dt=1;font=LOGFONT(h=-13);forecolor=5881621;notify=1;z=3} +plus={cls="plus";text="导入视频";left=14;top=28;right=113;bottom=58;bgcolor=-5197169;border={color=-16777216;radius=3;width=1};dl=0.03;dr=0.78;dt=1;font=LOGFONT(h=-13);forecolor=16777215;z=1}; +plus2={cls="plus";text="导入二维码";left=130;top=28;right=229;bottom=58;bgcolor=-5197169;border={color=-16777216;radius=3;width=1};dl=0.25;dr=0.56;dt=1;font=LOGFONT(h=-13);forecolor=16777215;notify=1;z=2}; +plus3={cls="plus";text="保存格式";left=408;top=28;right=507;bottom=58;bgcolor=-5197169;border={color=-16777216;radius=3;width=1};dl=0.78;dr=0.03;dt=1;font=LOGFONT(h=-13);forecolor=5881621;notify=1;z=3} ) /*}}*/ @@ -161,7 +161,7 @@ mainForm.plus3.oncommand = function(id,event){ ffmpeg.logResponse(mainForm.edit); ffmpeg.onResponseEnd = function(){ // ffmpeg -i input.mp4 -i overlay.png -filter_complex "overlay=10:10" output.mp4 - var str = `-i `++ videoPath ++` -i `++ qrcodePath_new ++` -filter_complex "overlay=`++ x ++`:`++ y ++ `" -y ` ++ vpath.dir ++ vpath.name ++`-output`++vpath.ext; + var str = `-i `++ videoPath ++` -i `++ qrcodePath_new ++` -filter_complex "overlay=`++ x ++`:`++ y ++ `" -y ` ++ io._exedir ++ vpath.name ++`-output`++vpath.ext; var ffmpeg = process.ffmpeg(, str); ffmpeg.logResponse(mainForm.edit); ffmpeg.onResponseEnd = function(){