Is there a way to encode and then decode BMP files?
Maybe i can apply some kind of a mask to bmp file so it couldn't be opened
and viewed, and only decoder programm can decode it and then bmp file would
be viewable?
I need to do it in VB Code.

Thanks for your help.

Re: Encode BMP files by Galen

Galen
Thu Apr 29 14:30:26 CDT 2004


"Mike Kanski" <mkanski@asi-solutions.com> wrote in message
news:ue9Oo6hLEHA.1272@tk2msftngp13.phx.gbl...
> Is there a way to encode and then decode BMP files?
> Maybe i can apply some kind of a mask to bmp file so it couldn't be opened
> and viewed, and only decoder programm can decode it and then bmp file
would
> be viewable?
> I need to do it in VB Code.
>
> Thanks for your help.
>
>

I do this quite a bit with AVI and MPG files. I read the entire file into a
byte array.

I use a simple structure as a Header. The Header has things like a
description, a date, etc.

I open a new file for output, with a name of my choosing. Write the Header
then add the byte array.

The User program opens this file and reads the Header and reads the
remainder into a byte array.
The byte array is written to a Temp file and fed to the Media player or
whatever.

Galen



Re: Encode BMP files by Jeff

Jeff
Thu Apr 29 14:59:21 CDT 2004


"Mike Kanski" <mkanski@asi-solutions.com> wrote in message
news:ue9Oo6hLEHA.1272@tk2msftngp13.phx.gbl...

> Is there a way to encode and then decode BMP files?
> Maybe i can apply some kind of a mask to bmp file so it couldn't be opened
> and viewed, and only decoder programm can decode it and then bmp file
would
> be viewable?
> I need to do it in VB Code.

That's called "encryption." Do a search on it.



Re: Encode BMP files by BeastFish

BeastFish
Thu Apr 29 17:19:08 CDT 2004

If memory serves me, Microsoft bitmap files have "BM" as the first two
characters in the header. Just altering those first two characters in the
header should be enough to make it unrecognizable with other graphic apps.
Something like...

Open MyBitmapFile For Binary As #1
Put #1, , "MB"
Close #1

...then change it back to "BM" (Put #1, , "BM") when you want to load it.

Or get a little inventive...

Dim Innie As String * 10
Dim Flipped As String * 10
Dim cc As Integer
Open MyBitmapFile For Binary As #1
Get #1, 1, Innie
For cc = 1 To 10
Mid$(Flipped, cc, 1) = Mid$(Innie, (11 - cc), 1)
Next cc
Put #1, 1, Flipped
Close #1


Whether trying this or any other encryption or header manipulation, I'd
suggest using a COPY of the bitmap file as a precaution.



"Mike Kanski" <mkanski@asi-solutions.com> wrote in message
news:ue9Oo6hLEHA.1272@tk2msftngp13.phx.gbl...
> Is there a way to encode and then decode BMP files?
> Maybe i can apply some kind of a mask to bmp file so it couldn't be opened
> and viewed, and only decoder programm can decode it and then bmp file
would
> be viewable?
> I need to do it in VB Code.
>
> Thanks for your help.