Capture ListIconGadget
Posted: Thu Apr 07, 2011 1:54 pm
there is a way to capture a listicon gadget with all of its row and columns ?
thanks.
thanks.
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
If OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0, 5, 5, 290, 90, "Name", 100, #PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(0, 1, "Address", 250)
AddGadgetItem(0, -1, "Harry Rannit"+Chr(10)+"12 Parliament Way, Battle Street, By the Bay")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 PureBasic Road, BigTown, CodeCity")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 PureBasic Road, BigTown, CodeCity")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 PureBasic Road, BigTown, CodeCity")
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
Code: Select all
Prototype.i p_PrintWindow(hWnd, hdc, flags)
OpenLibrary(1, "User32.dll")
PrintWindow.p_PrintWindow = GetFunction(1, "PrintWindow")
If OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0, 5, 5, 290, 90, "Name", 100, #PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(0, 1, "Address", 250)
AddGadgetItem(0, -1, "Harry Rannit"+Chr(10)+"12 Parliament Way, Battle Street, By the Bay")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 PureBasic Road, BigTown, CodeCity")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 PureBasic Road, BigTown, CodeCity")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 PureBasic Road, BigTown, CodeCity")
Result = CountGadgetItems(0)
SendMessage_(GadgetID(0), #LVM_GETITEMRECT, Result - 1,r.RECT)
ResizeWindow(0,#PB_Ignore,#PB_Ignore,r\right+40,r\bottom+30)
ResizeGadget(0,#PB_Ignore,#PB_Ignore,r\right+30,r\bottom+20)
If CreateImage(1,r\right+30,r\bottom+20, 24)
hdc = StartDrawing(ImageOutput(1))
If hdc
PrintWindow(GadgetID(0), hdc, 0)
StopDrawing()
EndIf
EndIf
SaveImage(1,"f:\savetest.bmp")
ResizeGadget(0,#PB_Ignore,#PB_Ignore,290,90)
ResizeWindow(0,#PB_Ignore,#PB_Ignore,300,100)
InvalidateRect_(GadgetID(0),0,#True)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf