Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetIcon: save as file
#3
Using GflAx:

Code:
Copy      Help
int hi=GetIcon("shell32.dll,16" 1)

typelib GflAx {059321F1-207A-47A7-93A1-29CDF876FDD3} 1.0
GflAx.GflAx g._create
;g.EnableLZW=TRUE ;;enable for gif
g.NewBitmap(32 32 0xffffff)
stdole.IPicture p=g.GetPicture

int dc=CreateCompatibleDC(0)
int oldbm=SelectObject(dc p.Handle)
DrawIconEx dc 0 0 hi 32 32 0 0 3
SelectObject dc oldbm
DeleteDC dc

g.SetPicture(p)
g.SaveFormatName="png"
g.SaveBitmap(_s.expandpath("$desktop$\test.png"))

Using SaveBitmap:
Code:
Copy      Help
int hi=GetIcon("shell32.dll,16" 1)

int dc=CreateCompatibleDC(0)
int dc0=GetDC(0)
int bm=CreateCompatibleBitmap(dc0 32 32)
ReleaseDC(0 dc0)
int oldbm=SelectObject(dc bm)
RECT r; r.right=32; r.bottom=32
FillRect dc &r GetStockObject(0) ;;WHITE_BRUSH
DrawIconEx dc 0 0 hi 32 32 0 0 3
SelectObject dc oldbm
DeleteDC dc

SaveBitmap bm "$desktop$\test.png"


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)