Qbasicnews.com
November 19, 2019, 11:38:29 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 2 [3]
  Print  
Author Topic: decrypt and win $100  (Read 17584 times)
Dio
I hold this place together
*****
Posts: 874



« Reply #30 on: August 06, 2006, 04:47:31 AM »

Quote from: "yetifoot"
it was on the FB IRC channel, so all the text of conversations is gone....


dammit. i knew it. i even looked around for a chat room. i think i found it. but no one was there or somthin'.

completely unrelated: does anyone know a good tut for uploading BMP into fb? thanks
Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #31 on: August 06, 2006, 02:11:15 PM »

Quote from: "Dio"
completely unrelated: does anyone know a good tut for uploading BMP into fb? thanks

BLOAD
http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgBload
Scroll down a bit.
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
Dio
I hold this place together
*****
Posts: 874



« Reply #32 on: August 07, 2006, 06:54:36 AM »

thanks. but you must keep this in mind:

-------
-------
---o--- <- average
-------
-------
-------
-------
---o---  <- me
---o---  <- mongoloid.
--------


i'm not kidding you guys when i say i suck at programming!  Smiley
when i learn a new tid-bit of info i scourer away and fiddle around with it like some sort of mad scientist. ok so where do i start?

'Load a graphic to current work page
Screen 18, 32
Cls
Bload "picture.bmp" where do i keep the picture? what file? what if the picture came in a download?
'Load a 48x48 bitmap into an array
Screen 18, 32
Dim garray(4 * (48 * 48 ) + 4) As Byte why *4? and + 4? and why as byte?
Bload "picture.bmp", @garray(0) what's with the @ and the (0)
Put (10,10),garray(0)



see, the thing about these tuts is that the author just assumes that the reader has some prior knowledge and is not a dumbass.
Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
red_Marvin
Na_th_an
*****
Posts: 1509



WWW
« Reply #33 on: August 07, 2006, 09:12:20 AM »

Explanation to 4*(w*h)+4:

"4*" is because in 32 bit, each pixel takes 4 bytes (rgba I guess) and
"+4" is to make room for storing w and h in the array so it get's read correctly. (I guess it's stored as two two byte integers)
Logged

/post]
yetifoot
Ancient Guru
****
Posts: 575



« Reply #34 on: August 07, 2006, 09:15:53 AM »

Quote
Bload "picture.bmp" where do i keep the picture? what file? what if the picture came in a download?

This is similar to Open in QB, it looks for the file in the current directory, which will normally be the same as the program.

Quote
Dim garray(4 * (48 * 48 ) + 4) As Byte why *4? and + 4? and why as byte?


*4 Is because each pixel takes 4 bytes to store in a 32bit mode, as red, green, blue and alpha bytes.
+4 is because there is a header on GET/PUT arrays of 4 bytes, that stores the images width, height and bytes per pixel.

Quote
Bload "picture.bmp", @garray(0) what's with the @ and the (0)


@garray(0) means the address of garray(0), this is basically telling it to bload to the start of garray.
Logged

EVEN MEN OF STEEL RUST.
Dio
I hold this place together
*****
Posts: 874



« Reply #35 on: August 08, 2006, 12:59:16 AM »

so the 4* and the +4 are always the same?

i tryed this:

Code:
Cls
Bload "picture.bmp"

'Load a 48x48 bitmap into an array
Screenres 1024,768,32,2,1
Dim garray(4 * (50 * 50) + 4) As Byte
Bload "picture.bmp", @garray(0)
Put (10,10),garray(0)
sleep


i put a picture called "picture.bmp" which is 50 * 50 into C:\FreeBASIC
all i got was a black screen.
Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Dio
I hold this place together
*****
Posts: 874



« Reply #36 on: August 08, 2006, 01:02:35 AM »

n/m it worked. i renamed "picture.bmp" to "picture"

silly me.  :roll:
Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Dio
I hold this place together
*****
Posts: 874



« Reply #37 on: August 08, 2006, 04:36:49 AM »

ok it's not working again. and all i did was save the bas of it

Code:
'Load a graphic to current work page
'Screenres 1024,768,32,2,1
Cls
Bload "picture.bmp"

'Load a 48x48 bitmap into an array
Screenres 1024,768,32,2,1
Dim garray(4 * (32 * 32) + 4) As Byte
Bload "picture.bmp", @garray(0)
Put (0,0),garray(0)
sleep
for y = 0 to 767
for x = 0 to 1023
  a = point(x,y)
  r = int(a/65536)
  a = a - r * 65536s
  g = int(a/256)
  a = a - g * 256
  b = a
  a = int((r+b+g)/3)
  pset (x,y),rgb(0,g,0)
next
next
sleep


i made sure and x & y were correct. and the picture was called "picture" and in C:\FreeBASIC

wtf happened?
Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Dio
I hold this place together
*****
Posts: 874



« Reply #38 on: August 08, 2006, 04:40:51 AM »

n/m

(4 post in a row?)
Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
anarky
Been there, done that
*****
Posts: 1231


The Blobworld Comics King


« Reply #39 on: August 08, 2006, 07:40:29 AM »

On this, can I use the same loading technique to store two or more images in the same array such as follows:

BLOAD image.ext to array$(0)
BLOAD image2.ext to array$(4*(640*480)+4)

? possible?
Logged

Screwing with your reality since 1998.
Dio
I hold this place together
*****
Posts: 874



« Reply #40 on: August 09, 2006, 03:42:29 AM »

how do i get a screen shot into fb? i'm making a screen saver (btw im gunna need to know how to do that) i want to try to avoid using clipboard.
Logged

quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #41 on: August 09, 2006, 02:34:53 PM »

Quote from: "Dio"
how do i get a screen shot into fb? i'm making a screen saver (btw im gunna need to know how to do that) i want to try to avoid using clipboard.


http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgBsave
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
red_Marvin
Na_th_an
*****
Posts: 1509



WWW
« Reply #42 on: August 09, 2006, 03:36:24 PM »

I think he meant a screenshot of the desktop to use in the program...

Anyway the, "4*" is only valid on 32 bit modes but I think it's always "+4"...
Logged

/post]
Pages: 1 2 [3]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!