Results 1 to 11 of 11

Thread: Embedding .bmp in App

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2018
    Posts
    602

    Embedding .bmp in App

    Hello,

    Currently in a small work app I have, I load a bitmap file into a Picture Box as selected by a user.
    There are 9 different bitmaps, and all reside in the project folder.
    They are loaded into Picture Box like so
    Code:
    Private Sub Option2_Click(Index As Integer)
        Select Case Index
            Case 0
                Picture1.Picture = LoadPicture("WeldPic0.bmp")
            Case 1
                Picture1.Picture = LoadPicture("WeldPic1.bmp")
            Case 2
                Picture1.Picture = LoadPicture("WeldPic2.bmp")
    ... etc
    I would like to create an executable file, and so would like to have these bitmaps somehow embedded into the exe
    Is this possible?

  2. #2
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,730

    Re: Embedding .bmp in App

    just create 9 pictureboxes and load the bmp into them. done.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2018
    Posts
    602

    Re: Embedding .bmp in App

    Make them all invisible (overtop eachother) then make the one the user selects visible?

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2018
    Posts
    602

    Re: Embedding .bmp in App

    OK thanks baka
    That in fact works.

    While I'm on this subject, is there another way?
    I'm thinking I've read of res files or something, in which you can embed bitmaps, waves, etc. ??

  5. #5
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,936

    Re: Embedding .bmp in App

    Yep, you can put anything you want into your resources.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  6. #6
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,730

    Re: Embedding .bmp in App

    I dont like to use the resource.
    one way, that require some work is to use a builder tool.
    so, the builder will merge the exe with all the bmp files + the filelist information.
    the exe itself need to be able to read that, reading the end of file to read the filelist and after that u can load the bmp like they where files

    thats how I do most of the time. not that hard to do really.
    I like it because I can change the files when I want, both add/delete/edit the pictures
    and when I want to release a new version, I just "compile" it using my own builder-tool.
    but I use a data-file that contain all the files, not merged into the exe (since I have 1GB of data, dont like to add that much into 1 exe)

  7. #7
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Embedding .bmp in App

    Save space by avoiding BMP. Use GIF or PNG, or for photographic images JPG.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2018
    Posts
    602

    Re: Embedding .bmp in App

    OK thanks.

    I found this tutorial https://www.thoughtco.com/how-to-use...in-vb6-3424276

    It says to Open Add-In Manager
    Then find and load VB6 Resource Editor

    I don't have any Add-Ins

  9. #9
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,936

    Re: Embedding .bmp in App

    The resource editor add-in comes with the VB6 IDE. If installed correctly, it should just "be there". Although, you still have to load it.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2018
    Posts
    602

    Re: Embedding .bmp in App

    OK thanks.

    On all my home machines, "Add-Ins" are displayed.
    Here on work machine, not one.

  11. #11
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,250

    Re: Embedding .bmp in App

    Quote Originally Posted by mms_ View Post
    On all my home machines, "Add-Ins" are displayed.
    Here on work machine, not one.
    Might be wise to raise this latter item in a new post with an appropriate title.
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

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