Hi,
I know that I can store Bitmaps, Cursors and Icons in a resource files. Can I also store .JPG files?
If not, how can I store 5 .JPG files in my app without first assinging them to 5 image controls and show/hide them?
Thanks.
Printable View
Hi,
I know that I can store Bitmaps, Cursors and Icons in a resource files. Can I also store .JPG files?
If not, how can I store 5 .JPG files in my app without first assinging them to 5 image controls and show/hide them?
Thanks.
Put them in a RES file, but instead of loading them as a Bitmap, load them as a Custom resource.
Thanks Megatron,
How do I do that? The following doesn't work...
imgBackImg.Picture = LoadResPicture(1, CUSTOM)
Should I replace 'CUSTOM' with something else?
Thanks.
Here you go:
Then call this function like this: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.tmp", "\MyPicture.tmp")
intFFN = FreeFile
Open strPath For Binary As intFFN
Put #intFFN, , bytArr
Close #intFFN
pPictureBox = LoadPicture(strPath)
Kill strPath
End Sub
Call RunPictureFromResource(101, Picture1)
Where
101 - is a resource ID
Picture1 - is a name of the PictureBox
[Edited by Serge on 08-17-2000 at 09:39 PM]