Help with GDip Beziehers

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jay lee
Posts: 83
Joined: 14 Oct 2021, 11:17

Help with GDip Beziehers

06 Feb 2024, 16:51

why does this code not make the edges correct?

Code: Select all

__New(bmp,w,h,rx,ry) {
        bmp2 := Gdip_CreateBitmap(w,h)
        brush := Gdip_CreateTextureBrush(bmp)
        this.path := Gdip_CreatePath()
        g := Gdip_GraphicsFromImage(bmp2)
        x := 0, y := 0
        DllCall("GdiPlus\GdipStartPathFigure", "Ptr", path)
        
        bx := rx*0.5522847498
        this.AddBezier(0,ry,0,ry-bx,rx-bx,0,rx,0)
        this.AddBezier(w-rx,0,w-rx+bx,0,w,bx,w,ry)
        this.AddBezier(w,h-ry,w,h-bx,w-rx+bx,h,w-rx,h)
        this.AddBezier(rx,h,rx-bx,h,0,h-ry+bx,0,h-ry)
        
        
        DllCall("GdiPlus\GdipClosePathFigure", "Ptr", this.path)
        Gdip_FillPath(g,brush,this.path)
        Gdip_DeleteGraphics(g)
        Gdip_DeletePath(path)
        Gdip_DisposeImage(bmp)
        return bmp2
 }
image.png
image.png (654 Bytes) Viewed 231 times
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Help with GDip Beziehers

08 Feb 2024, 07:46

jay lee wrote:
06 Feb 2024, 16:51
why does this code not make the edges correct?
Set the SmoothingMode to a value of 2 or 4

Code: Select all

SmoothingMode := 2
pGraphics := Gdip_GraphicsFromImage( pBitmap )
Gdip_SetSmoothingMode( pGraphics , SmoothingMode )
jay lee
Posts: 83
Joined: 14 Oct 2021, 11:17

Re: Help with GDip Beziehers

10 Feb 2024, 09:19

Hellbent wrote:
08 Feb 2024, 07:46
jay lee wrote:
06 Feb 2024, 16:51
why does this code not make the edges correct?
Set the SmoothingMode to a value of 2 or 4

Code: Select all

SmoothingMode := 2
pGraphics := Gdip_GraphicsFromImage( pBitmap )
Gdip_SetSmoothingMode( pGraphics , SmoothingMode )
thank you, this is not the exact answer I wanted but it works I guess.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: CodeKiller, teadrinker and 195 guests