imagelistコントロール内にいくつかの画像を含むVB6.0アプリケーションがあります。これらの画像がシステムのどこに保存されているか知りたい(これらの画像を別のアプリケーションで使用したいので、システムに画像を個別に持っていないため)したがって、唯一の方法はVisualbasic6.0プロジェクトから画像を取得することです。.Netに似たリソースフォルダのようなものはありますか?
すぐに知らせてください。
ありがとうルパ
Microsoft Windows Common Controls 5.0 or 6.0
Form1
ImageList1
このコードを使用
Dim lIdx As Long
For lIdx = 1 To ImageList1.ListImages.Count
SavePicture ImageList1.ListImages(lIdx).Picture, "C:\TEMP\img" & lIdx & ".bmp"
Next
少し前に同じ問題に遭遇しました。イメージリスト内の各イメージを「手動で」ディスクに保存するイメージリストを使用して、小さな関数をフォームに記述しました。
' utility to save images from a VB6 imagelist - example ExtractVB6ImageListImages(ImageListModes,"ImageListModes")
Function ExtractVB6ImageListImages(myimagelist As ImageList, listname As String)
Dim nCount As Integer
Dim nIndex As Integer
Dim sKey As String
Dim temp As Image
nCount = myimagelist.ListImages.count()
For nIndex = 1 To nCount
If nIndex < 10 Then
SavePicture myimagelist.ListImages(nIndex).Picture, listname + "00" + Mid(Str(nIndex), 2) + ".bmp"
ElseIf nIndex < 100 Then
SavePicture myimagelist.ListImages(nIndex).Picture, listname + "0" + Mid(Str(nIndex), 2) + ".bmp"
Else
SavePicture myimagelist.ListImages(nIndex).Picture, listname + Mid(Str(nIndex), 2) + ".bmp"
End If
Next
End Function