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
}