Results 1 to 32 of 32

Thread: [RESOLVED] Store binary data in UserControl?

Threaded View

  1. #13
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Store binary data in UserControl?

    Here's another idea, untested. I don't have VB on this box, so bear with me.

    Technically, you can include any binary data you want as a 32bpp bitmap. So, using a little creativity...

    This is a bit of a hack.

    1. Personally, going this route, I don't think I combine all your binary data into 1 bitmap. Use an image control per binary "file"
    -- entire image file is the bitmap's data, not just the image pixel info

    2. You will need to add some overhead to know the actual size of the embedded image file because your 32bpp bitmap data will be DWord aligned, equal to or larger than the file
    -- could be a simple as a 4 byte value as the first "pixel" in the bitmap.

    3. At runtime, you'll need to get the pixel data (which is really your file) via APIs like GetDibits.

    If interested, play with a test project to get your logic down. That project should dynamically build a valid bitmap that simply embeds a selected file and can display the bitmap (pixel gibberish) to ensure your bitmap is valid. Then of course, create the routines needed to extract the embedded file. Of course you'll have a ctx file when all said and done. As for the bitmap dimensions? If the file size is < 1gb, might as well make it a bitmap 1 x (file size + overhead) divided by 4 and rounded up to DWord


    Edited: I think I actually have code a home that does something like this. I wrote it as a test when I was playing with steganography. But I'm at work and won't be at my pc for another 12 hours
    Last edited by LaVolpe; Apr 10th, 2020 at 10:07 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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