whats wrong
Blitz3D Forums/Blitz3D Programming/whats wrong
| ||
can somone tell me whats wrong with this code pleasssse. THis isnt the whole code.. just the functions.. it will not load or save.. |
| ||
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 |
| ||
ok, here is my code |
| ||
what you trying to do buddy? |
| ||
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.. |
| ||
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") |
| ||
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)? |