Sign in to follow this  
Followers 0
seres

is it possible to use bicubic on guicontrolcreatepic

2 posts in this topic

#1 ·  Posted (edited)

hello, i search a lot and tried a lot to use bicubic on _GUICtrlCreateGIF   but all i can found is to use bicubic with gdiplus,

here is a cleaned code of my tries 

 

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <ScreenCapture.au3>
#include "GIFAnimation.au3"

Example()


Func Example()

    Local $hGUI = GUICreate("GDI+ test", 600, 600) ;create a test gui to display the resized image
    GUISetState(@SW_SHOW)



        _GDIPlus_Startup()

        $ImgLoadorg = GUICtrlCreatePic(@ScriptDir & "\z.npg", 300,0,200,200)
;~      $ImgLoadbic = GUICtrlCreatePic(@ScriptDir & "\3 (2).jpg", 300,300,200,200)
        $ImgLoad = @ScriptDir & "\3 (2).jpg"

        $IMG2 = _GDIPlus_ImageLoadFromFile($ImgLoadorg)
        $hGraphics2 = _GDIPlus_GraphicsCreateFromHWND($ImgLoadorg)


        ; Calculate the ratio of the image
        $ImageWidth = _GDIPlus_ImageGetWidth($IMG2)
        $ImageHeight = _GDIPlus_ImageGetHeight($IMG2)

        _GDIPlus_GraphicsSetInterpolationMode($hGraphics2, 7)
        _GDIPlus_GraphicsDrawImageRect($hGraphics2, $IMG2, 300, 300, 200, 200)

        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                                        ;ORIGINAL
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        $IMG = _GDIPlus_ImageLoadFromFile($ImgLoad)
        $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)


        ; Calculate the ratio of the image
        $ImageWidth = _GDIPlus_ImageGetWidth($IMG)
        $ImageHeight = _GDIPlus_ImageGetHeight($IMG)

        _GDIPlus_GraphicsSetInterpolationMode($hGraphics, 7)
        _GDIPlus_GraphicsDrawImageRect($hGraphics, $IMG, 0, 0, 200, 200)
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                                        ;ORIGINAL
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd

        _GDIPlus_ImageDispose($IMG)
        _GDIPlus_Shutdown()
;~      GUICtrlSetData($label, $FileList[$imagefile])


    GUIDelete($hGUI)
EndFunc   ;==>Example

 

Edited by seres

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

.

 

Edited by seres

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