Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
picture encryption
#11
no, i mean how to upload picture into FB so that while in the fb program i see the image from the bmp displayed on the screen. and, if i want, save the bmp back onto my computer in a new file or, if i wish, save over the file that i drew the bmp from in the first place.
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#12
and, if possible, have the computer detect the dimension (that means how big the picture is) automatically.
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#13
Code:
bload "mybmp.bmp"

dim as integer bmp_x, bmpy
dim as any ptr bmp_img

bmp_img = imagecreate( bmp_x, bmp_y )

get( 0, 0 )-( bmp_x - 1, bmp_y - 1 ), bmp_img

bsave "mynewbmp.bmp", bmp_img


i believe thats how. you can also skip a step

Code:
dim as integer bmp_x, bmpy
dim as any ptr bmp_img

bmp_img = imagecreate( bmp_x, bmp_y )

bload "mybmp.bmp", bmp_img

put( 20, 20 ), bmp_img

bmp_x and bmp_y would of course contain the dimensions of the image
Reply
#14
cool thanks. Smile
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#15
Why not just encrypt the BMP or whatever file instead of messing around with the individual pixels?
Reply
#16
i thought about this for awhile and the came to a simple answer:








i don't know how.
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#17
Just to add more shortening to the much debated ( :winkwink: ) code...
Code:
pset (x,y), point(rx,ry)
pset (rx ,ry), point(x,y)
8% of the teenage population smokes or has smoked pot. If you're one of the 2% who hasn't, copy and paste this in your signature.
Reply
#18
Quote:Just to add more shortening to the much debated ( :winkwink: ) code...
Code:
pset (x,y), point(rx,ry)
pset (rx ,ry), point(x,y)
That won't work. You'll put the same color back, instead of swapping the colors. :winkwink:
Reply
#19
...and lose the color at x, y in the process >.>
Reply
#20
Code:
#define infile "infile.bmp"
#define passfile "passfile.bmp"
#define outfile "outfile.enc"
dim as integer ifHandle,pfHandle,ofHandle,fpos
dim as ubyte ifTemp,passTemp
ifHandle=freefile
pfHandle=ifHandle+1
ofHandle=pfHandle+1
open infile for binary as #ifHandle
open passfile for binary as #pfHandle
open outfile for binary as #ofHandle
if lof(ifHandle)<>lof(pfHandle) then
    print "Error: different file lengths."
    sleep
    end
end if
do
    get #ifHandle,,ifTemp
    get #pfHandle,,passTemp
    put #ofHandle,,chr$(ifTemp xor passTemp)
    fpos+=1
    if fpos>=lof(ifHandle) then exit do
loop
print "Done."
sleep
close
There's a simple encryption app. Infile is the file you want to encrypt, passfile is the password file, and outfile holds the name of the encrypted file you want to create. Infile has to be EXACTLY the same size as passfile, otherwise it won't work (using a password the same length as the data to encrypt makes the code theoretically unbreakable). To decipher, put whatever outfile you used in the infile field, use the original passfile, and make up a name for the new, unciphered file.
If you are encrypting a bitmap file, make a password file by just opening up mspaint and drawing a picture that has the exact same dimensions of the picture you want to encrypt. (Note: that won't work for some compressed image formats like png, because even two pictures of the same dimensions will have different compressed sizes.)
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)