|
-
Oct 15th, 2000, 09:48 AM
#1
Thread Starter
Addicted Member
Does anyone know of some code that will load a BMP as an ICO? I have about 25 pics in BMP format and I dont want to convert them all to ICO using MicroAngelo or something..it would just be too tedious. And I have to use the pics as DragIcons
Thanks in advance
Cbomb
Techie 
-
Oct 15th, 2000, 09:50 AM
#2
transcendental analytic
Add a Imagelist in your app, add the bitmap to the imagelist and use it's extracticon method to create the icon, savepicture directly with that icon without having it on the picturebox or it won't be in ico format
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 15th, 2000, 10:04 AM
#3
Add the following code to a Form with an ImageList, PictureBox and CommandButton.
Code:
Private Sub Command1_Click()
ImageList1.ListImages.Add , "Pic1", Picture1.Picture
Picture1 = Nothing
Picture1 = ImageList1.ListImages(1).ExtractIcon
SavePicture Picture1, "C:\WINDOWS\DESKTOP\MYICON.ICO"
End Sub
Make sure there is a picture loaded in the PictureBox. When you press the CommandButton, it will convert the picture to an icon and save it on to your desktop with the name of MyIcon.ico.
-
Oct 15th, 2000, 01:37 PM
#4
Thread Starter
Addicted Member
This should be the last Q
Ok i see how that works...and i thought i could modify it but i guess not.... this code gives me an "index out of bounds" error at: TileList.ListImages.Add i, "Tile" & Str(i), Tile(i).Picture
Code:
For i = 0 To 13
TileList.ListImages.Add i, "Tile" & Str(i), Tile(i).Picture
tmppic = Nothing
tmppic = TileList.ListImages(i).ExtractIcon
SavePicture tmp, "C:\Graphics\RPG\tiles\icons\Tile" & Str(i) & ".ico"
Next i
Can ya tell me what im doing wrong here?...thanks again
Cbomb
Techie 
-
Oct 15th, 2000, 02:00 PM
#5
Thread Starter
Addicted Member
N/m
Nevermind guys i got it..thanks for your help
Cbomb
Techie 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|