Jump to content

is it possible to use bicubic on guicontrolcreatepic


seres
 Share

Recommended Posts

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...