

Until WaitWindowEvent() = #PB_Event_CloseWindow OldListIconCallback = SetWindowLong_(GadgetID(0), #GWL_WNDPROC, 10 more columns.ĪddGadgetColumn(0, 1, "Player names", 150) Subclass ListIcon so we can customdraw the header text HHeader = SendMessage_(GadgetID(0), #LVM_GETHEADER, 0, 0) ListIconGadget(0, 175, 150, 700, 500, "No.", 30, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection) If OpenWindow(0, 0, 0, 1024, 768, "", #PB_Window_ScreenCentered | #PB_Window_BorderLess) Text$=GetGadgetItemText(0, -1, *pnmcd\dwItemSpec)ĭrawFrameControl_(*pnmcd\hdc, *pnmcd\rc, #DFC_BUTTON, #DFCS_BUTTONPUSH|#DFCS_PUSHED)ĭrawFrameControl_(*pnmcd\hdc, *pnmcd\rc, #DFC_BUTTON, #DFCS_BUTTONPUSH)ĭrawText_(*pnmcd\hdc, Len(text$), *pnmcd\rc, #DT_CENTER|#DT_VCENTER|#DT_SINGLELINE|#DT_END_ELLIPSIS) > Get handle to ListIcon header control Result = CallWindowProc_(oldListIconCallback, hWnd, uMsg, wParam, lParam) Procedure SubclassedListIcon(hWnd, uMsg, wParam, lParam) Global oldListIconCallback, hHeader, brush \pt\X = P\X - 1 : \pt\Y = P\Y - 1 Global Dim Color(\pt\X, \pt\Y)ĮndIf EndWith EndProcedure Procedure GetDistance(A1,A2) - GetDistance(a1,a2) ProcedureReturn Sqr(A1 *A1 + A2 *A2)ĮndProcedure Procedure Near(X,Y) X, Y, ArrSize, ARRAY P.Code: Select all #LVM_GETHEADER = #LVM_FIRST + 31 MenuItem( #CornerNumbers, "Switch Corner Numbers") If MMK = 1 : _Showflag = 0: ProcedureReturn : EndIf show interruptusĮndIf *P\X =ImageWidth(IMG): *P\Y =ImageHeight(IMG)ĮndIf EndProcedure Procedure Menu(Win = 0) - Menu(win) Protected Menu = CreateMenu( - 1, WindowID(Win)) I = 0 Repeat Increase Stp for slow processorīox(Grid(i, j)\X, Grid(i, j)\Y, 1, 1, Color(i, j))ĮndWith EndProcedure Procedure Polyg( Sides, *P,RGB =- 1) P= array of POINT struc with polyg vertices sides >1 If RGB >- 1ĮndIf If _ShowCornerNumbers : Corners() : EndIf For i = 0 To \pt\X STP =\pt\X / 120 LONGER STP = QUICKER DRAWING Next EndProcedure Macro InitGrid() - InitGrid()ĮndMacro Procedure FastImage() - Faster than ShowImage - ONLY POINTS to circumvent the Polygon drawing Static i,j,STPĮndIf If _ShowCornerNumbers : Corners() : EndIf If StpY =- 1:StpY =StpX: EndIf If RGB =- 1:RGB = $555555: EndIf For Y = 0 To He Next Next EndWith EndProcedure Procedure FastGrid(Wi,He,StpX = 24,StpY =- 1,RGB =- 1) \S2\Y = (\Vertx\Y - \Vertx\Y) / \pt\Y step Y VER RIGHT \S2\X = (\Vertx\X - \Vertx\X) / \pt\Y step X VER RIGHT \S2\Y = (\Vertx\Y - \Vertx\Y) / \pt\Y step Y VER LEFT \S2\X = (\Vertx\X - \Vertx\X) / \pt\Y step X VER LEFT \S2\Y = (\Vertx\Y - \Vertx\Y) / \pt\X step Y HOR BOTTOM \S2\X = (\Vertx\X - \Vertx\X) / \pt\X step X HOR BOTTOM \S2\Y = (\Vertx\Y - \Vertx\Y) / \pt\X step Y HOR TOP \S2\X = (\Vertx\X - \Vertx\X) / \pt\X step X HOR TOP _Xmax = 0 : _Xmin = _X : _Ymax = 0 : _Ymin = _Y \s1 = (_Flex\Vertx\Y - _Flex\Vertx\Y) / E \s1 = (_Flex\Vertx\X - _Flex\Vertx\X) / E Next EndWith EndProcedure Procedure STP(A,B,C,D,E) - STP(A,B,C,D,E) - aux de Sizes With _Flex _Xmax = 0 : _Xmin = $FFFFFF:_Ymax = 0:_Ymin = $FFFFFF For i = 0 To 3 Next EndWith EndProcedure Procedure Bounding() - Bounding() Protected i ProcedureReturn |MMy Wi : DrawText(X,(Y +Y1) / 2 -TextHeight / 2, T)Įlse : DrawText((X +X1) / 2 -TextWidth / 2, (Y1 +Y) / 2 -TextHeight / 2, T)ĮndProcedure Procedure Corners() - draw corners Protected iĬircle (\Vertx\X, \Vertx\Y, 9, #DBLUE)ĬenterTXT(\Vertx\X - 5,\Vertx\Y - 5, 10, 10,Str(i))

WindowFromPoint_(MMx |MMy B :A =B: EndIf : EndMacro Procedure InMousEX(X,Y,X1,Y1) #DBLUE = $660000 #LBLUE = $FFFCC2 Enumeration #ImGad #IMG #IMG2 #Open #SaveAs #CornerNumbers #Quit #HorVer #Diag #Grid #GridIMG EndEnumeration Macro MMx : WindowMouseX(EventWindow()) : EndMacro Macro MMy : WindowMouseY(EventWindow()) : EndMacro Macro MMKĪbs(GetAsyncKeyState_( #VK_LBUTTON) +GetAsyncKeyState_( #VK_RBUTTON) * 2 +GetAsyncKeyState_( #VK_MBUTTON) * 3) / $8000 EndMacro Macro MouseOverGad - MouseOverGad : ret GadgetID under mouse Title$ = "Image Rotate, Pull, Reverse & Stretch" Global _OldBrush,_Pen,_PenRGB,_PenStyle,_ShowCornerNumbers = 1,_Showflag = 1 Global _X,_Xmax,_Xmin,_Y,_Ymax,_Ymin Global _MyFont10 =FontID(LoadFont( - 1, "Arial", 10)) Sélectionnez "Image Rotate, Pull, Reverse & Stretch" Structure PointF : X.f : Y.f : EndStructure Structure FLEXĮndStructure Global _Clip ,_Hatch,_Rim SetTextAlign_(hdc, #TA_LEFT | #TA_BOTTOM) OldPen = SelectObject_(hdc, GetStockObject_( #WHITE_PEN)) OldBrush = SelectObject_(hdc, GetStockObject_( #NULL_BRUSH)) Text$ = "NO IMAGE DEFINED!" If OpenWindow( 0, 0, 0, 600, 600, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
#Purebasic transparent window code
Sélectionnez Based on code by Bluid-fyte.
