mesale0077 Posted January 26, 2013 Share Posted January 26, 2013 (edited) how perforated image convertimage to image point convert or perforated image PictArraylike this examlelike this #FUNCTION# ============================================================== #Region Perforated Image #FUNCTION# ============================================================== Func _GuiImageHole($window_handle, $pos_x, $pos_y,$Image_Width ,$Image_Height) Local $aClassList, $aM_Mask, $aMask, $Block_value #Region picture array Local $PictArray[262] = [ _ '3,1,48,1','50,1,137,1','3,2,48,2','50,2,93,2','94,2,137,2','1,3,2,3','4,3,47,3','49,3,92,3','95,3,137,3','1,4,3,4','5,4,25,4','28,4,46,4','48,4,92,4','95,4,137,4','1,5,3,5','5,5,25,5','29,5,45,5','48,5,92,5','95,5,137,5','1,6,4,6', _ '6,6,24,6','30,6,45,6','47,6,92,6','96,6,137,6','1,7,5,7','7,7,9,7','10,7,23,7','30,7,38,7','42,7,44,7','46,7,93,7','96,7,137,7','1,8,6,8','11,8,24,8','29,8,37,8','45,8,66,8','68,8,93,8','96,8,137,8','1,9,6,9','13,9,24,9','30,9,36,9', _ '44,9,66,9','69,9,87,9','91,9,93,9','97,9,137,9','1,10,6,10','13,10,23,10','31,10,37,10','43,10,65,10','71,10,86,10','92,10,93,10','97,10,137,10','1,11,6,11','12,11,22,11','32,11,35,11','42,11,65,11','71,11,86,11','92,11,93,11','97,11,137,11','1,12,6,12','15,12,22,12', _ '32,12,34,12','43,12,50,12','54,12,65,12','70,12,86,12','97,12,137,12','1,13,5,13','18,13,21,13','32,13,33,13','44,13,49,13','55,13,65,13','72,13,86,13','96,13,137,13','1,14,5,14','15,14,16,14','44,14,48,14','55,14,64,14','73,14,86,14','96,14,137,14','1,15,4,15','15,15,20,15', _ '45,15,48,15','54,15,64,15','74,15,85,15','96,15,137,15','1,16,4,16','17,16,19,16','46,16,48,16','55,16,63,16','75,16,84,16','96,16,137,16','1,17,5,17','17,17,18,17','46,17,47,17','56,17,63,17','76,17,84,17','97,17,137,17','1,18,5,18','17,18,18,18','46,18,47,18','56,18,63,18', _ '77,18,84,18','97,18,137,18','1,19,6,19','16,19,18,19','33,19,34,19','57,19,63,19','77,19,84,19','98,19,137,19','1,20,6,20','16,20,17,20','32,20,34,20','58,20,63,20','77,20,84,20','98,20,137,20','1,21,6,21','16,21,17,21','32,21,34,21','58,21,63,21','78,21,83,21','98,21,137,21', _ '1,22,6,22','32,22,34,22','58,22,63,22','78,22,83,22','98,22,137,22','1,23,6,23','57,23,64,23','78,23,82,23','98,23,137,23','1,24,6,24','57,24,65,24','78,24,82,24','98,24,137,24','1,25,6,25','58,25,65,25','77,25,82,25','99,25,137,25','1,26,6,26','58,26,64,26','76,26,83,26', _ '99,26,137,26','1,27,7,27','32,27,33,27','46,27,47,27','58,27,64,27','77,27,83,27','100,27,137,27','1,28,7,28','31,28,33,28','46,28,47,28','58,28,65,28','77,28,83,28','99,28,137,28','2,29,7,29','31,29,33,29','59,29,65,29','78,29,84,29','98,29,137,29','7,30,8,30','16,30,18,30', _ '31,30,33,30','46,30,47,30','59,30,65,30','79,30,84,30','96,30,137,30','8,31,10,31','15,31,18,31','25,31,26,31','31,31,34,31','45,31,47,31','60,31,62,31','79,31,85,31','95,31,137,31','3,32,6,32','8,32,10,32','15,32,21,32','25,32,26,32','33,32,34,32','42,32,48,32','60,32,62,32', _ '78,32,85,32','95,32,137,32','34,33,35,33','39,33,40,33','42,33,49,33','60,33,62,33','76,33,86,33','95,33,120,33','125,33,130,33','135,33,137,33','38,34,39,34','44,34,51,34','76,34,88,34','95,34,122,34','125,34,129,34','131,34,134,34','135,34,137,34','47,35,51,35','55,35,60,35','64,35,65,35', _ '76,35,88,35','95,35,121,35','123,35,124,35','126,35,128,35','130,35,134,35','135,35,137,35','49,36,51,36','56,36,62,36','65,36,66,36','69,36,70,36','76,36,81,36','83,36,88,36','95,36,120,36','122,36,124,36','126,36,127,36','129,36,137,36','56,37,58,37','66,37,70,37','76,37,78,37','84,37,88,37', _ '95,37,120,37','122,37,124,37','126,37,127,37','129,37,131,37','135,37,137,37','67,38,71,38','77,38,79,38','84,38,89,38','95,38,119,38','126,38,127,38','129,38,132,38','134,38,137,38','32,39,33,39','85,39,89,39','95,39,118,39','120,39,124,39','126,39,127,39','129,39,132,39','134,39,137,39','18,40,24,40', _ '26,40,41,40','86,40,89,40','95,40,117,40','121,40,123,40','127,40,128,40','134,40,137,40','14,41,46,41','85,41,89,41','95,41,137,41','9,42,52,42','88,42,89,42','97,42,137,42','7,43,55,43','57,43,59,43','62,43,65,43','67,43,69,43','70,43,73,43','100,43,137,43','6,44,79,44','100,44,137,44', _ '4,45,81,45','100,45,137,45'] #EndRegion picture arraythank you now Edited January 27, 2013 by mesale0077 Code removed Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 26, 2013 Moderators Share Posted January 26, 2013 mesale0077, That code was unreadable - full of BB tags. Best you repost using the basic editor. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
mesale0077 Posted January 27, 2013 Author Share Posted January 27, 2013 (edited) picture ,I want to make the coordinates as follows$VAR3 = FileOpenDialog("image", "", "All files (*.*)", 1 + 4)point , convert perforated image PictArrayLocal $PictArray[262] = [ _ '3,1,48,1','50,1,137,1','3,2,48,2','50,2,93,2','94,2,137,2','1,3,2,3','4,3,47,3','49,3,92,3','95,3,137,3','1,4,3,4','5,4,25,4','28,4,46,4','48,4,92,4','95,4,137,4','1,5,3,5','5,5,25,5','29,5,45,5','48,5,92,5','95,5,137,5','1,6,4,6', _ '6,6,24,6','30,6,45,6','47,6,92,6','96,6,137,6','1,7,5,7','7,7,9,7','10,7,23,7','30,7,38,7','42,7,44,7','46,7,93,7','96,7,137,7','1,8,6,8','11,8,24,8','29,8,37,8','45,8,66,8','68,8,93,8','96,8,137,8','1,9,6,9','13,9,24,9','30,9,36,9', _ '44,9,66,9','69,9,87,9', .............orlike thisexpandcollapse popup#include #include #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 447, 0, 210, $WS_POPUP) GUISetBkColor ( 0x8B4513, $Form1 ) ;~ GUICtrlCreateLabel("", 0, 0, 633, 447, -1, $GUI_WS_EX_PARENTDRAG) ;~ GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) # ==> Start Local $_Left_pos, $_Top_pos, $_GUI_NAME $_Left_pos = 0 $_Top_pos = 0 _GuiImageHole($Form1, $_Left_pos, $_Top_pos, 633, 447) # <== End GUISetState(@SW_SHOW, $Form1) #EndRegion ### END Koda GUI section ### For $i=1 To 600 Step +1 WinMove ( "Form1", "", 0+$i, 210 ) Next $Form2=GUICreate ( "Form2", 536, 376, 600, 210, $WS_POPUP ) GUISetBkColor ( 0xABCDEF, $Form2 ) GUISetFont ( 13, 400, 2, "Arial", $Form2 ) GUICtrlCreateLabel ( "GUDE!!", 390, 150, 80, 25 ) # ==> Start Local $_Left_pos, $_Top_pos, $_GUI_NAME $_Left_pos = 0 $_Top_pos = 0 _GuiImageHoleBild2($Form2, $_Left_pos, $_Top_pos, 536, 376) # <== End GUISetState(@SW_SHOW, $Form2) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd #FUNCTION# ============================================================== Func _GuiImageHoleBild2($window_handle, $pos_x, $pos_y,$Image_Width ,$Image_Height) Local $aClassList, $aM_Mask, $aMask #Region picture array Local $PictArray[90] $PictArray[0] = '460,118,469,118' $PictArray[1] = '449,119,478,119' $PictArray[2] = '442,120,481,120' $PictArray[3] = '438,121,485,121' $PictArray[4] = '434,122,488,122' $PictArray[5] = '430,123,490,123' $PictArray[6] = '426,124,492,124' $PictArray[7] = '423,125,494,125' $PictArray[8] = '420,126,495,126' $PictArray[9] = '417,127,496,127' $PictArray[10] = '415,128,498,128' $PictArray[11] = '412,129,499,129' $PictArray[12] = '409,130,500,130' $PictArray[13] = '406,131,501,131' $PictArray[14] = '404,132,502,132' $PictArray[15] = '402,133,502,133' $PictArray[16] = '400,134,503,134' $PictArray[17] = '398,135,504,135' $PictArray[18] = '395,136,504,136' $PictArray[19] = '393,137,505,137' $PictArray[20] = '391,138,506,138' $PictArray[21] = '389,139,506,139' $PictArray[22] = '387,140,506,140' $PictArray[23] = '385,141,507,141' $PictArray[24] = '383,142,507,142' $PictArray[25] = '381,143,507,143' $PictArray[26] = '380,144,507,144' $PictArray[27] = '378,145,508,145' $PictArray[28] = '376,146,508,146' $PictArray[29] = '374,147,508,147' $PictArray[30] = '372,148,508,148' $PictArray[31] = '370,149,508,149' $PictArray[32] = '369,150,508,150' $PictArray[33] = '367,151,508,151' $PictArray[34] = '365,152,508,152' $PictArray[35] = '364,153,507,153' $PictArray[36] = '362,154,507,154' $PictArray[37] = '361,155,507,155' $PictArray[38] = '359,156,507,156' $PictArray[39] = '357,157,506,157' $PictArray[40] = '356,158,506,158' $PictArray[41] = '354,159,506,159' $PictArray[42] = '353,160,505,160' $PictArray[43] = '351,161,505,161' $PictArray[44] = '349,162,505,162' $PictArray[45] = '348,163,504,163' $PictArray[46] = '346,164,504,164' $PictArray[47] = '345,165,503,165' $PictArray[48] = '343,166,503,166' $PictArray[49] = '342,167,502,167' $PictArray[50] = '341,168,501,168' $PictArray[51] = '339,169,500,169' $PictArray[52] = '338,170,500,170' $PictArray[53] = '336,171,499,171' $PictArray[54] = '335,172,498,172' $PictArray[55] = '334,173,498,173' $PictArray[56] = '332,174,497,174' $PictArray[57] = '331,175,496,175' $PictArray[58] = '329,176,495,176' $PictArray[59] = '328,177,494,177' $PictArray[60] = '327,178,492,178' $PictArray[61] = '325,179,491,179' $PictArray[62] = '324,180,490,180' $PictArray[63] = '322,181,489,181' $PictArray[64] = '321,182,488,182' $PictArray[65] = '320,183,487,183' $PictArray[66] = '319,184,485,184' $PictArray[67] = '317,185,484,185' $PictArray[68] = '316,186,482,186' $PictArray[69] = '315,187,481,187' $PictArray[70] = '314,188,479,188' $PictArray[71] = '312,189,478,189' $PictArray[72] = '311,190,476,190' $PictArray[73] = '310,191,474,191' $PictArray[74] = '309,192,472,192' $PictArray[75] = '307,193,470,193' $PictArray[76] = '306,194,468,194' $PictArray[77] = '305,195,465,195' $PictArray[78] = '304,196,463,196' $PictArray[79] = '307,197,460,197' $PictArray[80] = '312,198,458,198' $PictArray[81] = '317,199,455,199' $PictArray[82] = '321,200,451,200' $PictArray[83] = '326,201,448,201' $PictArray[84] = '331,202,444,202' $PictArray[85] = '338,203,440,203' $PictArray[86] = '345,204,435,204' $PictArray[87] = '352,205,429,205' $PictArray[88] = '359,206,423,206' $PictArray[89] = '373,207,411,207' #EndRegion picture array ; get the size of the active window $size = WinGetClientSize($window_handle) $Window_width = $size[0] $Window_height = $size[1] + 40 ; include height of title bar up to 30 dots ; First hide the window $aClassList = StringSplit(_WinGetClassListEx($window_handle), @LF) $aM_Mask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', 0, 'long', 0, 'long', 0, 'long', 0) ; rectangle A - left side $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', 0, 'long', 0, 'long', $pos_x, 'long', $Window_height) DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2) ; rectangle B - Top $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', 0, 'long', 0, 'long', $Window_width, 'long', $pos_y) DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2) ; rectangle C - Right side $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', $pos_x + $Image_Width , 'long', 0 , 'long', $Window_width + 30, 'long', $Window_height) DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2) ; rectangle D - Bottom $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', 0 , 'long', $pos_y + $Image_Height, 'long', $Window_width, 'long', $Window_height) DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2) ; now unhide all regions as defined in array $PictArray For $i = 0 To (UBound($PictArray) - 1) $Block_value = StringSplit($PictArray[$i],',') $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', $pos_x + $Block_value[1] - 2 , 'long', $pos_y + $Block_value[2], 'long', $pos_x + $Block_value[3], 'long', $pos_y + $Block_value[4] -1) DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2) Next DllCall('user32.dll', 'long', 'SetWindowRgn', 'hwnd', $window_handle, 'long', $aM_Mask[0], 'int', 1) $PictArray='' ; empty array EndFunc ;==>_GuiImageHole #FUNCTION# ============================================================== Func _GuiImageHole($window_handle, $pos_x, $pos_y,$Image_Width ,$Image_Height) Local $aClassList, $aM_Mask, $aMask #Region picture array Local $PictArray[364] $PictArray[0] = '277,43,278,43' $PictArray[1] = '128,44,129,44' $PictArray[2] = '277,44,278,44' $PictArray[3] = '127,45,129,45' $PictArray[4] = '276,45,278,45' $PictArray[5] = '127,46,129,46' $PictArray[6] = '276,46,278,46' $PictArray[7] = '127,47,129,47' $PictArray[8] = '276,47,278,47' $PictArray[9] = '127,48,129,48' $PictArray[10] = '276,48,278,48' $PictArray[11] = '127,49,129,49' $PictArray[12] = '275,49,278,49' $PictArray[13] = '127,50,129,50' $PictArray[14] = '275,50,278,50' $PictArray[15] = '127,51,129,51' $PictArray[16] = '275,51,278,51' $PictArray[17] = '127,52,129,52' $PictArray[18] = '275,52,278,52' $PictArray[19] = '127,53,129,53' $PictArray[20] = '274,53,278,53' $PictArray[21] = '127,54,129,54' $PictArray[22] = '274,54,278,54' $PictArray[23] = '127,55,129,55' $PictArray[24] = '274,55,278,55' $PictArray[25] = '127,56,129,56' $PictArray[26] = '274,56,278,56' $PictArray[27] = '127,57,129,57' $PictArray[28] = '273,57,278,57' $PictArray[29] = '127,58,130,58' $PictArray[30] = '273,58,278,58' $PictArray[31] = '127,59,130,59' $PictArray[32] = '273,59,278,59' $PictArray[33] = '127,60,130,60' $PictArray[34] = '273,60,278,60' $PictArray[35] = '127,61,130,61' $PictArray[36] = '272,61,278,61' $PictArray[37] = '126,62,130,62' $PictArray[38] = '272,62,278,62' $PictArray[39] = '126,63,131,63' $PictArray[40] = '272,63,278,63' $PictArray[41] = '126,64,131,64' $PictArray[42] = '271,64,278,64' $PictArray[43] = '126,65,131,65' $PictArray[44] = '271,65,278,65' $PictArray[45] = '126,66,131,66' $PictArray[46] = '271,66,278,66' $PictArray[47] = '126,67,131,67' $PictArray[48] = '271,67,278,67' $PictArray[49] = '126,68,131,68' $PictArray[50] = '270,68,278,68' $PictArray[51] = '126,69,132,69' $PictArray[52] = '270,69,278,69' $PictArray[53] = '126,70,132,70' $PictArray[54] = '270,70,278,70' $PictArray[55] = '126,71,132,71' $PictArray[56] = '270,71,278,71' $PictArray[57] = '126,72,132,72' $PictArray[58] = '269,72,278,72' $PictArray[59] = '126,73,133,73' $PictArray[60] = '269,73,278,73' $PictArray[61] = '125,74,133,74' $PictArray[62] = '269,74,278,74' $PictArray[63] = '125,75,133,75' $PictArray[64] = '268,75,278,75' $PictArray[65] = '125,76,133,76' $PictArray[66] = '268,76,278,76' $PictArray[67] = '125,77,134,77' $PictArray[68] = '268,77,278,77' $PictArray[69] = '125,78,134,78' $PictArray[70] = '267,78,278,78' $PictArray[71] = '125,79,134,79' $PictArray[72] = '267,79,278,79' $PictArray[73] = '125,80,134,80' $PictArray[74] = '267,80,278,80' $PictArray[75] = '125,81,135,81' $PictArray[76] = '266,81,278,81' $PictArray[77] = '125,82,135,82' $PictArray[78] = '266,82,278,82' $PictArray[79] = '125,83,135,83' $PictArray[80] = '266,83,278,83' $PictArray[81] = '125,84,136,84' $PictArray[82] = '265,84,278,84' $PictArray[83] = '125,85,136,85' $PictArray[84] = '265,85,278,85' $PictArray[85] = '125,86,137,86' $PictArray[86] = '265,86,278,86' $PictArray[87] = '125,87,137,87' $PictArray[88] = '264,87,278,87' $PictArray[89] = '125,88,137,88' $PictArray[90] = '264,88,278,88' $PictArray[91] = '125,89,138,89' $PictArray[92] = '264,89,278,89' $PictArray[93] = '125,90,138,90' $PictArray[94] = '263,90,278,90' $PictArray[95] = '125,91,139,91' $PictArray[96] = '263,91,278,91' $PictArray[97] = '125,92,140,92' $PictArray[98] = '262,92,278,92' $PictArray[99] = '125,93,140,93' $PictArray[100] = '262,93,278,93' $PictArray[101] = '125,94,141,94' $PictArray[102] = '261,94,278,94' $PictArray[103] = '125,95,142,95' $PictArray[104] = '261,95,278,95' $PictArray[105] = '125,96,142,96' $PictArray[106] = '261,96,277,96' $PictArray[107] = '125,97,143,97' $PictArray[108] = '260,97,277,97' $PictArray[109] = '125,98,144,98' $PictArray[110] = '260,98,277,98' $PictArray[111] = '125,99,144,99' $PictArray[112] = '259,99,277,99' $PictArray[113] = '125,100,145,100' $PictArray[114] = '259,100,277,100' $PictArray[115] = '125,101,146,101' $PictArray[116] = '258,101,277,101' $PictArray[117] = '125,102,147,102' $PictArray[118] = '258,102,277,102' $PictArray[119] = '125,103,148,103' $PictArray[120] = '257,103,277,103' $PictArray[121] = '126,104,149,104' $PictArray[122] = '257,104,277,104' $PictArray[123] = '126,105,150,105' $PictArray[124] = '256,105,277,105' $PictArray[125] = '126,106,151,106' $PictArray[126] = '255,106,276,106' $PictArray[127] = '126,107,151,107' $PictArray[128] = '255,107,276,107' $PictArray[129] = '126,108,152,108' $PictArray[130] = '254,108,276,108' $PictArray[131] = '127,109,153,109' $PictArray[132] = '253,109,276,109' $PictArray[133] = '127,110,154,110' $PictArray[134] = '253,110,276,110' $PictArray[135] = '127,111,155,111' $PictArray[136] = '252,111,275,111' $PictArray[137] = '127,112,156,112' $PictArray[138] = '251,112,275,112' $PictArray[139] = '128,113,156,113' $PictArray[140] = '250,113,275,113' $PictArray[141] = '128,114,157,114' $PictArray[142] = '249,114,275,114' $PictArray[143] = '129,115,158,115' $PictArray[144] = '248,115,274,115' $PictArray[145] = '130,116,158,116' $PictArray[146] = '247,116,274,116' $PictArray[147] = '130,117,159,117' $PictArray[148] = '246,117,274,117' $PictArray[149] = '131,118,160,118' $PictArray[150] = '245,118,273,118' $PictArray[151] = '132,119,160,119' $PictArray[152] = '244,119,273,119' $PictArray[153] = '132,120,161,120' $PictArray[154] = '243,120,272,120' $PictArray[155] = '133,121,161,121' $PictArray[156] = '241,121,272,121' $PictArray[157] = '134,122,162,122' $PictArray[158] = '240,122,271,122' $PictArray[159] = '135,123,162,123' $PictArray[160] = '239,123,271,123' $PictArray[161] = '136,124,163,124' $PictArray[162] = '237,124,270,124' $PictArray[163] = '137,125,163,125' $PictArray[164] = '236,125,269,125' $PictArray[165] = '138,126,164,126' $PictArray[166] = '235,126,268,126' $PictArray[167] = '139,127,164,127' $PictArray[168] = '234,127,268,127' $PictArray[169] = '141,128,165,128' $PictArray[170] = '232,128,267,128' $PictArray[171] = '142,129,165,129' $PictArray[172] = '231,129,266,129' $PictArray[173] = '143,130,166,130' $PictArray[174] = '230,130,264,130' $PictArray[175] = '145,131,166,131' $PictArray[176] = '229,131,263,131' $PictArray[177] = '146,132,167,132' $PictArray[178] = '227,132,262,132' $PictArray[179] = '148,133,167,133' $PictArray[180] = '226,133,260,133' $PictArray[181] = '150,134,168,134' $PictArray[182] = '225,134,258,134' $PictArray[183] = '152,135,168,135' $PictArray[184] = '224,135,256,135' $PictArray[185] = '153,136,168,136' $PictArray[186] = '223,136,254,136' $PictArray[187] = '155,137,169,137' $PictArray[188] = '222,137,251,137' $PictArray[189] = '157,138,169,138' $PictArray[190] = '220,138,249,138' $PictArray[191] = '159,139,169,139' $PictArray[192] = '219,139,245,139' $PictArray[193] = '161,140,170,140' $PictArray[194] = '218,140,241,140' $PictArray[195] = '163,141,170,141' $PictArray[196] = '217,141,237,141' $PictArray[197] = '165,142,171,142' $PictArray[198] = '216,142,233,142' $PictArray[199] = '167,143,171,143' $PictArray[200] = '215,143,228,143' $PictArray[201] = '168,144,179,144' $PictArray[202] = '214,144,223,144' $PictArray[203] = '171,145,199,145' $PictArray[204] = '213,145,218,145' $PictArray[205] = '171,146,219,146' $PictArray[206] = '169,147,230,147' $PictArray[207] = '167,148,230,148' $PictArray[208] = '166,149,231,149' $PictArray[209] = '164,150,232,150' $PictArray[210] = '162,151,233,151' $PictArray[211] = '160,152,234,152' $PictArray[212] = '158,153,236,153' $PictArray[213] = '157,154,237,154' $PictArray[214] = '155,155,238,155' $PictArray[215] = '153,156,239,156' $PictArray[216] = '151,157,240,157' $PictArray[217] = '150,158,241,158' $PictArray[218] = '148,159,242,159' $PictArray[219] = '146,160,243,160' $PictArray[220] = '144,161,227,161' $PictArray[221] = '228,161,244,161' $PictArray[222] = '143,162,225,162' $PictArray[223] = '228,162,245,162' $PictArray[224] = '141,163,188,163' $PictArray[225] = '191,163,224,163' $PictArray[226] = '228,163,247,163' $PictArray[227] = '139,164,186,164' $PictArray[228] = '193,164,223,164' $PictArray[229] = '229,164,248,164' $PictArray[230] = '137,165,184,165' $PictArray[231] = '193,165,223,165' $PictArray[232] = '229,165,249,165' $PictArray[233] = '136,166,184,166' $PictArray[234] = '194,166,222,166' $PictArray[235] = '229,166,250,166' $PictArray[236] = '134,167,185,167' $PictArray[237] = '195,167,221,167' $PictArray[238] = '229,167,251,167' $PictArray[239] = '132,168,186,168' $PictArray[240] = '194,168,221,168' $PictArray[241] = '229,168,252,168' $PictArray[242] = '130,169,187,169' $PictArray[243] = '194,169,221,169' $PictArray[244] = '228,169,253,169' $PictArray[245] = '128,170,188,170' $PictArray[246] = '193,170,221,170' $PictArray[247] = '228,170,254,170' $PictArray[248] = '127,171,189,171' $PictArray[249] = '191,171,222,171' $PictArray[250] = '228,171,255,171' $PictArray[251] = '125,172,223,172' $PictArray[252] = '227,172,257,172' $PictArray[253] = '123,173,224,173' $PictArray[254] = '226,173,258,173' $PictArray[255] = '121,174,259,174' $PictArray[256] = '120,175,260,175' $PictArray[257] = '119,176,261,176' $PictArray[258] = '118,177,262,177' $PictArray[259] = '117,178,263,178' $PictArray[260] = '116,179,264,179' $PictArray[261] = '115,180,265,180' $PictArray[262] = '114,181,267,181' $PictArray[263] = '113,182,268,182' $PictArray[264] = '112,183,266,183' $PictArray[265] = '268,183,269,183' $PictArray[266] = '111,184,265,184' $PictArray[267] = '269,184,270,184' $PictArray[268] = '110,185,264,185' $PictArray[269] = '270,185,271,185' $PictArray[270] = '109,186,263,186' $PictArray[271] = '271,186,272,186' $PictArray[272] = '108,187,263,187' $PictArray[273] = '272,187,273,187' $PictArray[274] = '107,188,263,188' $PictArray[275] = '272,188,273,188' $PictArray[276] = '106,189,262,189' $PictArray[277] = '272,189,273,189' $PictArray[278] = '105,190,263,190' $PictArray[279] = '272,190,273,190' $PictArray[280] = '104,191,265,191' $PictArray[281] = '272,191,273,191' $PictArray[282] = '103,192,267,192' $PictArray[283] = '271,192,272,192' $PictArray[284] = '102,193,270,193' $PictArray[285] = '271,193,272,193' $PictArray[286] = '101,194,272,194' $PictArray[287] = '100,195,272,195' $PictArray[288] = '99,196,272,196' $PictArray[289] = '98,197,272,197' $PictArray[290] = '97,198,272,198' $PictArray[291] = '96,199,272,199' $PictArray[292] = '95,200,272,200' $PictArray[293] = '94,201,271,201' $PictArray[294] = '93,202,271,202' $PictArray[295] = '92,203,271,203' $PictArray[296] = '91,204,271,204' $PictArray[297] = '90,205,271,205' $PictArray[298] = '89,206,271,206' $PictArray[299] = '88,207,271,207' $PictArray[300] = '87,208,271,208' $PictArray[301] = '86,209,271,209' $PictArray[302] = '85,210,270,210' $PictArray[303] = '84,211,270,211' $PictArray[304] = '83,212,270,212' $PictArray[305] = '82,213,270,213' $PictArray[306] = '81,214,270,214' $PictArray[307] = '80,215,270,215' $PictArray[308] = '79,216,270,216' $PictArray[309] = '78,217,270,217' $PictArray[310] = '77,218,270,218' $PictArray[311] = '76,219,233,219' $PictArray[312] = '252,219,270,219' $PictArray[313] = '75,220,252,220' $PictArray[314] = '74,221,269,221' $PictArray[315] = '73,222,269,222' $PictArray[316] = '72,223,269,223' $PictArray[317] = '71,224,269,224' $PictArray[318] = '70,225,269,225' $PictArray[319] = '69,226,269,226' $PictArray[320] = '68,227,269,227' $PictArray[321] = '67,228,269,228' $PictArray[322] = '66,229,67,229' $PictArray[323] = '68,229,268,229' $PictArray[324] = '70,230,268,230' $PictArray[325] = '72,231,179,231' $PictArray[326] = '195,231,268,231' $PictArray[327] = '74,232,178,232' $PictArray[328] = '224,232,268,232' $PictArray[329] = '76,233,176,233' $PictArray[330] = '253,233,268,233' $PictArray[331] = '78,234,175,234' $PictArray[332] = '80,235,174,235' $PictArray[333] = '82,236,173,236' $PictArray[334] = '84,237,172,237' $PictArray[335] = '86,238,171,238' $PictArray[336] = '87,239,169,239' $PictArray[337] = '89,240,168,240' $PictArray[338] = '91,241,167,241' $PictArray[339] = '93,242,166,242' $PictArray[340] = '95,243,165,243' $PictArray[341] = '97,244,164,244' $PictArray[342] = '99,245,162,245' $PictArray[343] = '101,246,161,246' $PictArray[344] = '103,247,160,247' $PictArray[345] = '104,248,159,248' $PictArray[346] = '106,249,158,249' $PictArray[347] = '108,250,157,250' $PictArray[348] = '110,251,155,251' $PictArray[349] = '112,252,154,252' $PictArray[350] = '114,253,153,253' $PictArray[351] = '116,254,152,254' $PictArray[352] = '118,255,151,255' $PictArray[353] = '120,256,150,256' $PictArray[354] = '122,257,148,257' $PictArray[355] = '123,258,147,258' $PictArray[356] = '125,259,146,259' $PictArray[357] = '127,260,145,260' $PictArray[358] = '129,261,144,261' $PictArray[359] = '131,262,143,262' $PictArray[360] = '133,263,141,263' $PictArray[361] = '135,264,140,264' $PictArray[362] = '137,265,139,265' $PictArray[363] = '139,266,140,266' #EndRegion picture array ; get the size of the active window $size = WinGetClientSize($window_handle) $Window_width = $size[0] $Window_height = $size[1] + 40 ; include height of title bar up to 30 dots ; First hide the window $aClassList = StringSplit(_WinGetClassListEx($window_handle), @LF) $aM_Mask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', 0, 'long', 0, 'long', 0, 'long', 0) ; rectangle A - left side $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', 0, 'long', 0, 'long', $pos_x, 'long', $Window_height) DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2) ; rectangle B - Top $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', 0, 'long', 0, 'long', $Window_width, 'long', $pos_y) DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2) ; rectangle C - Right side $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', $pos_x + $Image_Width , 'long', 0 , 'long', $Window_width + 30, 'long', $Window_height) DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2) ; rectangle D - Bottom $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', 0 , 'long', $pos_y + $Image_Height, 'long', $Window_width, 'long', $Window_height) DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2) ; now unhide all regions as defined in array $PictArray For $i = 0 To (UBound($PictArray) - 1) $Block_value = StringSplit($PictArray[$i],',') $aMask = DllCall('gdi32.dll', 'long', 'CreateRectRgn', 'long', $pos_x + $Block_value[1] - 2 , 'long', $pos_y + $Block_value[2], 'long', $pos_x + $Block_value[3], 'long', $pos_y + $Block_value[4] -1) DllCall('gdi32.dll', 'long', 'CombineRgn', 'long', $aM_Mask[0], 'long', $aMask[0], 'long', $aM_Mask[0], 'int', 2) Next DllCall('user32.dll', 'long', 'SetWindowRgn', 'hwnd', $window_handle, 'long', $aM_Mask[0], 'int', 1) $PictArray='' ; empty array EndFunc ;==>_GuiImageHole #FUNCTION# ============================================================== Func _WinGetClassListEx($sTitle) Local $sClassList = WinGetClassList($sTitle) Local $aClassList = StringSplit($sClassList, @LF) Local $sRetClassList = '', $sHold_List = '|' Local $aiInHold, $iInHold For $i = 1 To UBound($aClassList) - 1 If $aClassList[$i] = '' Then ContinueLoop If StringRegExp($sHold_List, '\|' & $aClassList[$i] & '~(\d+)\|') Then $aiInHold = StringRegExp($sHold_List, '.*\|' & $aClassList[$i] & '~(\d+)\|.*', 1) $iInHold = Number($aiInHold[UBound($aiInHold)-1]) If $iInHold = 0 Then $iInHold += 1 $aClassList[$i] &= '~' & $iInHold + 1 $sHold_List &= $aClassList[$i] & '|' $sRetClassList &= $aClassList[$i] & @LF Else $aClassList[$i] &= '~1' $sHold_List &= $aClassList[$i] & '|' $sRetClassList &= $aClassList[$i] & @LF EndIf Next Return StringReplace(StringStripWS($sRetClassList, 3), '~', '') EndFunc ;==>_WinGetClassListEx #FUNCTION# ============================================================== #EndRegion Perforated Imageorlike this point#Include Global Const $ALTERNATE = 1 Global Const $WINDING = 2 $hForm = GUICreate('MyGUI', 400, 400, -1, -1, $WS_POPUP) GUISetBkColor(0x880000) $tPOINT = DllStructCreate('int[2];int[2];int[2];int[2];int[2];int[2]') DllStructSetData($tPOINT, 1, 0, 1) DllStructSetData($tPOINT, 1, 0, 2) DllStructSetData($tPOINT, 2, 360, 1) DllStructSetData($tPOINT, 2, 0, 2) DllStructSetData($tPOINT, 3, 400, 1) DllStructSetData($tPOINT, 3, 40, 2) DllStructSetData($tPOINT, 4, 400, 1) DllStructSetData($tPOINT, 4, 400, 2) DllStructSetData($tPOINT, 5, 40, 1) DllStructSetData($tPOINT, 5, 400, 2) DllStructSetData($tPOINT, 6, 0, 1) DllStructSetData($tPOINT, 6, 360, 2) $Ret = DllCall('gdi32.dll', 'ptr', 'CreatePolygonRgn', 'ptr', DllStructGetPtr($tPOINT), 'int', 6, 'int', $ALTERNATE) DllCall('user32.dll', 'int', 'SetWindowRgn', 'hwnd', $hForm, 'ptr', $Ret[0], 'int', 1) GUISetState() Do Until GUIGetMsg() = -3orlike this Buble regionexpandcollapse popup#include #include #include ; get height of window title and width of window frame - may be different when XP theme is ON/OFF Global $htit = _WinAPI_GetSystemMetrics($SM_CYCAPTION) Global $frame = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME) Local $gui = GUICreate("Test Windows regions", 350, 210) Local $btn_default = GUICtrlCreateButton("Default region", 100, 30, 150) Local $btn_round = GUICtrlCreateButton("Round region", 100, 60, 150) Local $btn_buble = GUICtrlCreateButton("Buble region ", 100, 90, 150) Local $btn_transparent = GUICtrlCreateButton("Transparent region", 100, 120, 150) Local $btn_exit = GUICtrlCreateButton("Exit", 100, 150, 150) GUISetState(@SW_SHOW) Local $pos = WinGetPos($gui) ; get whole window size (no client size defined in GUICreate) Global $width = $pos[2] Global $height = $pos[3] Local $msg, $rgn While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $btn_exit ExitLoop Case $msg = $btn_default $rgn = _WinAPI_CreateRectRgn(0, 0, $width, $height) _WinAPI_SetWindowRgn($gui, $rgn) Case $msg = $btn_round $rgn = _WinAPI_CreateRoundRectRgn(0, 0, $width, $height, $width / 3, $height / 3) _WinAPI_SetWindowRgn($gui, $rgn) Case $msg = $btn_buble Local $rgn1 = _WinAPI_CreateRoundRectRgn(0, 0, $width / 2, $height / 2, $width / 2, $height / 2) ; left-top Local $rgn2 = _WinAPI_CreateRoundRectRgn($width / 2, 0, $width, $height / 2, $width / 2, $height / 2) ; right-top _WinAPI_CombineRgn($rgn1, $rgn1, $rgn2, $RGN_OR) _WinAPI_DeleteObject($rgn2) $rgn2 = _WinAPI_CreateRoundRectRgn(0, $height / 2, $width / 2, $height, $width / 2, $height / 2) ; left-bottom _WinAPI_CombineRgn($rgn1, $rgn1, $rgn2, $RGN_OR) _WinAPI_DeleteObject($rgn2) $rgn2 = _WinAPI_CreateRoundRectRgn($width / 2, $height / 2, $width, $height, $width / 2, $height / 2) ; right-bottom _WinAPI_CombineRgn($rgn1, $rgn1, $rgn2, $RGN_OR) _WinAPI_DeleteObject($rgn2) $rgn2 = _WinAPI_CreateRoundRectRgn(10, 10, $width - 10, $height - 10, $width, $height) ; middle _WinAPI_CombineRgn($rgn1, $rgn1, $rgn2, $RGN_OR) _WinAPI_DeleteObject($rgn2) _WinAPI_SetWindowRgn($gui, $rgn1) Case $msg = $btn_transparent _GuiHole($gui, 40, 40, 260, 170) EndSelect WEnd ; make inner transparent area but add controls Func _GuiHole($h_win, $i_x, $i_y, $i_sizew, $i_sizeh) Local $outer_rgn, $inner_rgn, $combined_rgn $outer_rgn = _WinAPI_CreateRectRgn(0, 0, $width, $height) $inner_rgn = _WinAPI_CreateRectRgn($i_x, $i_y, $i_x + $i_sizew, $i_y + $i_sizeh) $combined_rgn = _WinAPI_CreateRectRgn(0, 0, 0, 0) _WinAPI_CombineRgn($combined_rgn, $outer_rgn, $inner_rgn, $RGN_DIFF) _WinAPI_DeleteObject($outer_rgn) _WinAPI_DeleteObject($inner_rgn) _AddCtrlRegion($combined_rgn, $btn_default) _AddCtrlRegion($combined_rgn, $btn_round) _AddCtrlRegion($combined_rgn, $btn_buble) _AddCtrlRegion($combined_rgn, $btn_transparent) _AddCtrlRegion($combined_rgn, $btn_exit) _WinAPI_SetWindowRgn($h_win, $combined_rgn) EndFunc ;==>_GuiHole ; add control's area to given region ; respecting also window title/frame sizes Func _AddCtrlRegion($full_rgn, $ctrl_id) Local $ctrl_pos, $ctrl_rgn $ctrl_pos = ControlGetPos($gui, "", $ctrl_id) $ctrl_rgn = _WinAPI_CreateRectRgn($ctrl_pos[0] + $frame, $ctrl_pos[1] + $htit + $frame, _ $ctrl_pos[0] + $ctrl_pos[2] + $frame, $ctrl_pos[1] + $ctrl_pos[3] + $htit + $frame) _WinAPI_CombineRgn($full_rgn, $full_rgn, $ctrl_rgn, $RGN_OR) _WinAPI_DeleteObject($ctrl_rgn) EndFunc ;==>_AddCtrlRegionthank you now Edited January 27, 2013 by mesale0077 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now