找回密码
 加入
搜索
查看: 2123|回复: 3

[图形处理] 请问怎么让放大的图标边缘平滑一些【已解决】

[复制链接]
发表于 2011-12-3 09:44:25 | 显示全部楼层 |阅读模式
本帖最后由 eaglelin 于 2011-12-3 10:44 编辑

请问怎么让放大的图标边缘平滑一些
发表于 2011-12-3 10:12:37 | 显示全部楼层
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>
#include <array.au3>

_Main()

Func _Main()
        Local $listview, $hImage
        Local $exStyles = BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES,$LVS_EX_CHECKBOXES,$LVS_EX_SNAPTOGRID)
        
        GUICreate("ImageList GetBkColor", 800, 600)
        $listview = GUICtrlCreateListView("", 2, 2, 794, 568, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT))
        _GUICtrlListView_SetExtendedListViewStyle($listview, $exStyles)
        GUISetState()
        
        ; Load images
        $hImage = _GUIImageList_Create(48, 48, 5, 1)
        __GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 110)
        __GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 131)
        __GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 165)
        __GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 168)
        __GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 137)
        __GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 146)
        _GUICtrlListView_SetImageList($listview, $hImage, 1)

        ; Add columns
        _GUICtrlListView_AddColumn($listview, "Column 1", 200)
        _GUICtrlListView_AddColumn($listview, "Column 2", 200)
        _GUICtrlListView_AddColumn($listview, "Column 3", 100)
        _GUICtrlListView_SetColumnWidth($listview,2,$LVSCW_AUTOSIZE_USEHEADER)

        ; Add items
        _GUICtrlListView_AddItem($listview, "Row 1: Col 1", 1)
        _GUICtrlListView_AddSubItem($listview, 0, "Row 1: Col 2", 1, 1)
        _GUICtrlListView_AddSubItem($listview, 0, "Row 1: Col 3", 2, 2)
        _GUICtrlListView_AddItem($listview, "Row 2: Col 1", 1)
        _GUICtrlListView_AddSubItem($listview, 1, "Row 2: Col 2", 1, 2)
        _GUICtrlListView_AddItem($listview, "Row 3: Col 1", 2)
        _GUICtrlListView_AddItem($listview, "Row 4: Col 1", 3)
        _GUICtrlListView_AddItem($listview, "Row 5: Col 1", 4)
        _GUICtrlListView_AddSubItem($listview, 4, "Row 5: Col 2", 1, 3)
        _GUICtrlListView_AddItem($listview, "Row 6: Col 1", 5)
        _GUICtrlListView_AddSubItem($listview, 5, "Row 6: Col 2", 1, 4)
        _GUICtrlListView_AddSubItem($listview, 5, "Row 6: Col 3", 2, 3)

        ; Loop until user exits
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUIDelete()
EndFunc   ;==>_Main

Func _Icons_Icon_Extract($sIcon, $iIndex, $iWidth, $iHeight)
        Local $Ret = DllCall('shell32.dll', 'int', 'SHExtractIconsW', 'wstr', $sIcon, 'int', $iIndex, 'int', $iWidth, 'int', $iHeight, 'ptr*', 0, 'ptr*', 0, 'int', 1, 'int', 0)
        If (@error) Or ($Ret[0] = 0) Then
                Return SetError(1, 0, 0)
        EndIf
        Return $Ret[5]
EndFunc   ;==>_Icons_Icon_Extract

Func __GUIImageList_AddIcon($hWnd, $sFile, $iIndex = 0)
        Local $iRet
        $iRet = _Icons_Icon_Extract($sFile, $iIndex, _GUIImageList_GetIconWidth($hWnd), _GUIImageList_GetIconWidth($hWnd))
        If $iRet <= 0 Then Return SetError(-1, $iRet, 0)

        Local $hIcon = $iRet
        $iRet = _GUIImageList_ReplaceIcon($hWnd, -1, $hIcon)
        _WinAPI_DestroyIcon($hIcon)
        If $iRet = -1 Then Return SetError(-2, $iRet, 0)
        Return $iRet
EndFunc   ;==>__GUIImageList_AddIcon

评分

参与人数 1金钱 +30 收起 理由
afan + 30

查看全部评分

发表于 2011-12-3 10:16:29 | 显示全部楼层
向3mile 学习哈。。
 楼主| 发表于 2011-12-3 10:42:54 | 显示全部楼层
回复 2# 3mile


    非常感谢 !
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-1 07:24 , Processed in 0.081472 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表