12-07-2005, 07:56 AM
12-08-2005, 01:38 AM
Quote:well someone said that i should use if's in the loop, so i tried putting the whole thing into one big loop, but it didnt do any better, now the screen continuously flickers, maybe ill look for a source code for a paint program out thre and modify it to work with wat i want it to do and giv mucho credit to the creator(s), unless someone can figure out this danm code, it makes sense, until you run it
Try using Pages, that should remove flicker
12-08-2005, 03:56 AM
actually i got it to almost work, now i have gosubs that work properly, except as soon as i try to make another thing work properly, another one glitches, when i get home tonite, ill update my code on the first post, i tried using wat AGA last suggested
12-08-2005, 07:12 AM
pages are beyond me, it is screen 13 too just in case u need to know, updated code at 9:11 exact, thats wierd
12-08-2005, 09:09 AM
Here's something to mess with. At the very least, it will show you how to use a Sub, and how to use the mouse in FreeBASIC. Don't bother trying it under QB though.
Code:
#INCLUDE "FBGFX.BI"
Screen 13,,,1
Declare Sub Draw_Palette( MouseX, MouseY, Button, Paint_Color )
Declare Sub Draw_Big_Grid( MouseX, MouseY, Button, Paint_Color, Img_Data() )
Declare Sub Copy_Pixel_Data( Img_Data() )
Declare Sub Paste_Pixel_Data( Img_Data() )
Dim Img_Data(15, 15)
Do
Getmouse( MouseX, MouseY,,Button )
Draw_Palette( MouseX, MouseY, Button, Paint_Color )
Copy_Pixel_Data( Img_Data() )
Draw_Big_Grid( MouseX, MouseY, Button, Paint_Color, Img_Data() )
Paste_Pixel_Data( Img_Data() )
Line(0,0)-(17,17),31,B
Line(1,109)-(7, 116),31,B
Line(2,110)-(6, 115),Paint_Color,BF
Loop Until Multikey(SC_ESCAPE)
Sub Draw_Palette( MouseX, MouseY, Button, Paint_Color )
For Y = 0 To 15
For X = 0 To 15
Line(X*5,(Y*5)+120)-Step(4,4),Col,BF
If MouseX>=(X*5) And MouseX<=(X*5)+4 And MouseY>=(Y*5)+120 And MouseY<=(Y*5)+124 Then
Line(X*5,(Y*5)+120)-Step(4,4),31,B
If Button = 1 Then
Paint_Color = Col
End If
End If
Col+=1
If MouseX>=1 And MouseX<=16 And MouseY>=1 And MouseY<=16 Then
Select Case Button
Case 1
Pset(MouseX, MouseY), Paint_Color
Case 2
Paint_Color = Point(MouseX, MouseY)
End Select
End If
Next
Next
End Sub
Sub Draw_Big_Grid( MouseX, MouseY, Button, Paint_Color, Img_Data() )
For Y = 0 To 15
For X = 0 To 15
If MouseX>=(X*12)+100 And MouseX<=(X*12)+111 And MouseY>=(Y*12) And MouseY<=(Y*12)+11 Then
If Button = 1 Then
Img_Data(X,Y) = Paint_Color
Elseif Button = 2 Then
Paint_Color = Img_Data(X,Y)
End If
End If
Line((X*12)+100,Y*12)-Step(11,11),31,B
Line((X*12)+101,(Y*12)+1)-Step(9,9), Img_Data(X,Y),BF
Img_Data(X,Y) = Point((X*12)+101,(Y*12)+1)
Next
Next
End Sub
Sub Copy_Pixel_Data( Img_Data() )
For Y=0 To 15
For X = 0 To 15
Img_Data(X,Y) = Point(X+1,Y+1)
Next
Next
End Sub
Sub Paste_Pixel_Data( Img_Data() )
For Y=0 To 15
For X = 0 To 15
Pset(X+1,Y+1),Img_Data(X,Y)
Next
Next
End Sub
12-08-2005, 07:04 PM
well i tried a link to FBide but it desnt work, it sais it is missing fbc.exe, so i have no version of fb that works
12-08-2005, 07:25 PM
quick note, besides me not having fb is dont worry about the drawing part unless you really want to, im trying to do that on my own
12-08-2005, 08:25 PM
Click view>settings>Compiler>"...", then find your fb compiler..
12-08-2005, 09:37 PM
FBIDE isn't the compiler. You have to feed it the path to the commandline compiler itself, otherwise it won't work.
Also, you double-posted.
Also, you double-posted.
12-09-2005, 02:28 AM
but i dont have the compiler, i searched my whole cpu and i dont ahve the compiler