Results 1 to 5 of 5

Thread: Resource(.RES)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    Mexico
    Posts
    24

    Question

    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

  2. #2
    Guest
    Use LoadResPicture
    Code:
    LoadResPicture 1000, vbResBitmap

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    Mexico
    Posts
    24

    Smile

    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

  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    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

  5. #5
    Guest
    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
  •  



Click Here to Expand Forum to Full Width