ChrisL Posted August 3, 2010 Posted August 3, 2010 When using GDIPLUS can you draw to a control rather than a GUI HWND? All of the examples I have seen draw in to a single GUI HWND. I want to create a contact sheet on screen like the attached image, I am guessing that drawing each cell is the best way to do it with GDIPlus, but do I have to draw to the GUI HWND or could I make a grid of label or button controls and draw to each control, or would I make a series of child GUI's and draw to each of those? I tried $Label = GuiCtrlCreateLabel() and $hWND = GuiCtrlGetHandle($Label) but without success. Thanks Chris [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
AdmiralAlkex Posted August 3, 2010 Posted August 3, 2010 (edited) Sure, just do the usual (with the handle from GUICtrlGetHandle). Quick example: #Include <GDIPlus.au3> _GDIPlus_Startup() GUICreate("test", 640, 480) GUISetState() GUICtrlCreateLabel("", 100, 100, 200, 100) $Handle = GUICtrlGetHandle(-1) $graphics = _GDIPlus_GraphicsCreateFromHWND($Handle) _GDIPlus_GraphicsDrawString($graphics, "hello from Label", 5, 5) Do Until GUIGetMsg() = -3 ;$GUI_EVENT_CLOSE _GDIPlus_GraphicsDispose($graphics) _GDIPlus_Shutdown() I want to create a contact sheet on screen like the attached image, I am guessing that drawing each cell is the best way to do it with GDIPlus, but do I have to draw to the GUI HWND or could I make a grid of label or button controls and draw to each control, or would I make a series of child GUI's and draw to each of those?Doesn't really matter I would say, but the last one sounds complex. Just use whatever you are most comfortable with. Me myself, I probably wouldn't use GDI+ at all, but that's me. Edit: 2 more sentences. Edited August 4, 2010 by AdmiralAlkex Xandy 1 .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
ChrisL Posted August 4, 2010 Author Posted August 4, 2010 (edited) Thanks. Edited August 4, 2010 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
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