|
-
Aug 11th, 2000, 09:19 AM
#1
Thread Starter
Junior Member
Hello, I use gifs on my projects, is it possible to save them to a resource file? I added one like a custom resource but know I dont know how to read it.
Thanks,
Chicho
-
Aug 11th, 2000, 09:26 AM
#2
Use LoadResPicture
Code:
LoadResPicture 1000, vbResBitmap
-
Aug 11th, 2000, 09:51 AM
#3
Thread Starter
Junior Member
Ive tried -> LoadResPicture(104,vbresbitmap) but it tells me that the Resource is not found, this is probably because I added it as a custom resource, and I Cannot added as a bitmap unless I change the file extension. Do I have to change it?
Thanks,
Chicho
-
Aug 11th, 2000, 10:59 AM
#4
If you use Custom resource, then you would need a byte array to get the resource:
Code:
Public Sub RunPictureFromResource(pintResourceID As Integer, pPictureBox As PictureBox)
Dim bytArr() As Byte
Dim intFFN As Integer
Dim strPath As String
bytArr = LoadResData(pintResourceID, "CUSTOM")
strPath = App.Path & IIf(Right(App.Path, 1) = "\", MyPicture.gif", "\MyPicture.gif")
intFFN = FreeFile
Open strPath For Binary As intFFN
Put #intFFN, , bytArr
Close #intFFN
pPictureBox = LoadPicture(strPath)
Kill strPath
End Sub
Then call this function like this:
Call RunPictureFromResource(101, Picture1)
Where
101 - is a resource ID
Picture1 - is a name of the PictureBox
-
Aug 11th, 2000, 01:56 PM
#5
Here is an example on adding pictures or html files into a RES File using the Webbrowser Control.
How to use the RES Protocol of the Webbrowser Control or how to use a HTML Files in Resources.
I never looked at it yet, but it might be what you are looking for.
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
|