whats wrong

Blitz3D Forums/Blitz3D Programming/whats wrong

Oiduts Studios(Posted 2008) [#1]


can somone tell me whats wrong with this code pleasssse. THis isnt the whole code.. just the functions.. it will not load or save..


Ross C(Posted 2008) [#2]
Your savebuffer command isn't correct. You need to start a location to save too. If you read the docs, you'll see an example of the savebuffer function. The first instance of it anyway. The second one is correct.

I'm afraid i can't help till i see the code your using to call the functions etc


Oiduts Studios(Posted 2008) [#3]
ok, here is my code




Neochrome(Posted 2008) [#4]
what you trying to do buddy?


Oiduts Studios(Posted 2008) [#5]
I still cant get this paint program thing to load and save images can you help me? can you put the right code in the right places please. Im new to this..


Neochrome(Posted 2008) [#6]

Global IMAGE%

Graphics 800,600,32,2 	; FORCE a WINDOWED PANE

image = CreateImage(800,600)
SetBuffer(ImageBuffer(image))
Cls
;-------- DRAW SOME RANDOM STUFF ------------------
For i=0 To 1000
	Color Rnd(255),Rnd(255),Rnd(255)
	Line Rnd(800),Rnd(600),Rnd(800),Rnd(600)
	
Next

; DEMO SAVE IMAGE __ NOTE: IMAGEBUFFER
SaveBuffer(ImageBuffer(image),"c:\temp.bmp")


SetBuffer(BackBuffer())


While Not KeyHit(1)
	Cls
	DrawImage image,0,0
	Flip
Wend
End





; TO LOAD AN IMAGE 
image = LoadImage("c:\temp.bmp")



WolRon(Posted 2008) [#7]
blitz monkey;

instead of writing code like this:
Plot -1+Rnd(100),35+Rnd(100)
Plot -1+Rnd(100),35+Rnd(100)
Plot -1+Rnd(100),35+Rnd(100)
Plot -1+Rnd(100),35+Rnd(100)
Plot -1+Rnd(100),35+Rnd(100)
Plot -1+Rnd(100),35+Rnd(100)
Plot -1+Rnd(100),35+Rnd(100)
Plot -1+Rnd(100),35+Rnd(100)
Save yourself some time and use loops. What you have above could be written in three lines:
For iter = 1 to 8
  Plot -1+Rnd(100),35+Rnd(100)
Next


BTW, have you seen my programming tutorial (in my sig)?