cryton2707 Posted October 1, 2007 Share Posted October 1, 2007 Hi quick question.. Is it possible to say load a picture in one gui. then copy a section (x,y and x,y) of the picture to another gui? Ta Welcome to the internet :) where men are men! Women are men! and 16 year old women are FBI agents! Link to comment Share on other sites More sharing options...
JBeef Posted October 1, 2007 Share Posted October 1, 2007 (edited) maybe gdi32.dll - bitblt() - crazy ~Jap edit- BitBlt() do paint. need SetDIBits. too foogly - ~Jap edit- no say so expandcollapse popupGlobal Const $SRCCOPY = 0xcc0020 Global $WM_PAINT = 0x000F $gui = GUICreate("test",300,200,0,0) $pic = GUICtrlCreatePic(@WindowsDir & "\winnt256.bmp",0,0,275,174) $guicousin = GUICreate("test_tickle",300,200,0,300) $piccousin = GUICtrlCreatePic("",0,0,275,174) GUISetState(@SW_SHOW,$gui) GUISetState(@SW_SHOW,$guicousin) $hwnd = ControlGetHandle($gui,"",$pic) $hdc = DLLCall("user32.dll","int","GetDC","hwnd",$hwnd) $hwndcousin = ControlGetHandle($guicousin,"",$piccousin) $hdccousin = DLLCall("user32.dll","int","GetDC","hwnd",$hwndcousin) DLLCall("gdi32.dll","int","BitBlt","int",$hdccousin[0] _ ,"int",0,"int",0,"int",100,"int",100 _ ,"int",$hdc[0],"int",40,"int",20,"int",$SRCCOPY) GUIRegisterMsg($WM_PAINT, "paintcousin") While 1 GUISwitch($gui) If GUIGetMsg() = -3 Then ExitLoop GUISwitch($guicousin) If GUIGetMsg() = -3 Then ExitLoop WEnd DLLCall("user32.dll","int","ReleaseDC","hwnd",$gui,"int",$hdc[0]) DLLCall("user32.dll","int","ReleaseDC","hwnd",$guicousin,"int",$hdccousin[0]) Func paintcousin($hwnd, $msg, $wparam, $lparam) If Not ($hwnd=$guicousin) Then Return DLLCall("gdi32.dll","int","BitBlt","int",$hdccousin[0] _ ,"int",0,"int",0,"int",100,"int",100 _ ,"int",$hdc[0],"int",40,"int",20,"int",$SRCCOPY) EndFuncmaybe put BitBlt in paint func. ~Jap Edited October 1, 2007 by JBeef Link to comment Share on other sites More sharing options...
cryton2707 Posted October 1, 2007 Author Share Posted October 1, 2007 maybe gdi32.dll - bitblt()- crazy ~Japmaybe put BitBlt in paint func. ~JapLooks intresting.. I need to play with the code a little to A. completely understand it.. andB. see if I can make it do what I want Thanks for a pointer though Welcome to the internet :) where men are men! Women are men! and 16 year old women are FBI agents! 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