|
-
Nov 16th, 2000, 02:57 AM
#1
Thread Starter
Fanatic Member
I'm making a .dll like cards.dll, and i want to save the pics for the cards in the dll. I'm using the resource editor, but it only wants to save bmp's as pictures. My cards are gif's. I can save them as custom resources, but when i read them, they are returned as a byte array. How can i 'transform' them to IPictureDisp?
r0ach™
Don't forget to rate the post
-
Nov 16th, 2000, 05:29 AM
#2
Lively Member
Here you go, just pass in the location were you want the file saved, and the id number of the resource. It assumes that your resource is in 'custom', if it isn't you can add another parameter to this...
Code:
''To save a gif from the resource file
BuildResource("c:\temp\my gif.gif",101)
''This function will save any custom resource file on to your disk.
Public Function BuildResource(destFILE As String, resID As Integer) As String
On Error GoTo ErrorBuildFileFromResource
Dim resBYTE() As Byte
resBYTE = LoadResData(resID, "CUSTOM")
Open destFILE For Binary Access Write As #1
Put #1, , resBYTE
Close #1
Exit Function
ErrorBuildFileFromResource:
Exit Function
End Function
-
Nov 16th, 2000, 05:36 AM
#3
Thread Starter
Fanatic Member
Thanks.
I would prefer not to save the data to a file. I just want to load it into a picture box.
r0ach™
Don't forget to rate the post
-
Nov 16th, 2000, 05:44 AM
#4
Lively Member
Not sure if you can 
Can't you get your app to dump the gifs somewere on the pc when it loads (i.e. in the temp folder) and then delete them when it closes ??
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
|