Sign in to follow this  
Followers 0
cryton2707

can you cut a guipic?

3 posts in this topic

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!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

maybe gdi32.dll - bitblt()

- crazy ~Jap

edit- BitBlt() do paint. need SetDIBits. too foogly - ~Jap

edit- no say so

Global 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)
EndFunc
maybe put BitBlt in paint func. ~Jap Edited by JBeef

Share this post


Link to post
Share on other sites

maybe gdi32.dll - bitblt()

- crazy ~Jap

maybe put BitBlt in paint func. ~Jap

Looks intresting.. I need to play with the code a little to

A. completely understand it.. and

B. 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!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0