Jump to content
Sign in to follow this  
aldakrys

Need Help - GDI Image scrolling

Recommended Posts

aldakrys

Hello,

 

I'm having trouble with "Test1".

"Test2" works but I would like for "Test1" to work.

Clearly I'm doing something wrong so some help would be much appreciated.

 

Thank you in advance.

Test1.au3

Test2.au3

post-50188-0-65379900-1393873159_thumb.j

Edited by Melba23
Amended title

Share this post


Link to post
Share on other sites
JLogan3o13

Instead of saying "its broke" and expecting us to read through 1000 lines of code, can you please be just a bit more descriptive of what is not working for you, as well as what error checking you have tried? ;)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
aldakrys

Instead of saying "its broke" and expecting us to read through 1000 lines of code, can you please be just a bit more descriptive of what is not working for you, as well as what error checking you have tried? ;)

 

Ok,

In "Test1" after the GUI is generated when you move the scrollbars the image disappears. I would like to be able to scroll like in "Test2".

This works.

Func Pr()

    $AdGUI = GUICreate("Zone Map", $DimL, $DimH, -1, -1, _
                                      BitOR($WS_CAPTION, $WS_SYSMENU, $WS_MAXIMIZEBOX), $WS_EX_COMPOSITED)
    GUISetState(@SW_SHOW)

    _GUIScrollbars_Generate($AdGUI, $L, $H, 0, 0, False)

    $Imagine = GUICtrlCreatePic($PIC, 0, 0, $L, $H)

While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                Exit
        EndSelect
WEnd
EndFunc

This doesn't.

Func Pr()

    $AdGUI = GUICreate("Zone Map", $DimL, $DimH, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU))
    GUISetState(@SW_SHOW)

    _GUIScrollbars_Generate($AdGUI, $L, $H, 0, 0, False)

    _GDIPlus_Startup()

    $hImage = _GDIPlus_ImageLoadFromFile($PIC)
    $hBitmap = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $L, "int", $H, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
    $hBitmap = $hBitmap[6]
    $hBmpCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    $aResult = DllCall($ghGDIPDll, "int", "GdipSetInterpolationMode", "handle", $hBmpCtxt, "int", $iInterpolationMode)
    _GDIPlus_GraphicsDrawImageRect($hBmpCtxt, $hImage, 0, 0, $L, $H)

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($AdGUI)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)

    _GDIPlus_Shutdown()

    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hBmpCtxt)
    _GDIPlus_ImageDispose($PIC)

While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                Exit
        EndSelect
WEnd
EndFunc

Thank you.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.