ThePentiumGuy
Well-known member
Hey,
Is there a way to use ur Graphics object in another class? For example, Ive done something like
public class Gameclass
Public shared gfx as Graphics
Public Sub Paint(e as painteventargs)
gfx = e.graphics
gfx.drawimage("etc...") <-- this line works ... but
end sub
end class
Public class clsSomething
Public sub Paint()
gameclass.gfx.drawimage("etc...") <-- this one doesnt.
End Sub
End class
Oh btw, im getting the graphics by going to form1_paint:
myGameClass.Paint(e)
Im getting an argument error (In clsSomething.Paint), although Im using the exact same arguments for DrawImage in GameClass as well as clsSomething.
Whats going on?
I just want to be able to draw from other classes (preferably from the graphics object in GameClass). Or should I take another route and use AddHandler in GameClass to do the same, if so - can you please remind me how to use it? Heh I need to brush up my AddHandler skills.
-The Pentium Guy
-The Pentium Guy
Is there a way to use ur Graphics object in another class? For example, Ive done something like
public class Gameclass
Public shared gfx as Graphics
Public Sub Paint(e as painteventargs)
gfx = e.graphics
gfx.drawimage("etc...") <-- this line works ... but
end sub
end class
Public class clsSomething
Public sub Paint()
gameclass.gfx.drawimage("etc...") <-- this one doesnt.
End Sub
End class
Oh btw, im getting the graphics by going to form1_paint:
myGameClass.Paint(e)
Im getting an argument error (In clsSomething.Paint), although Im using the exact same arguments for DrawImage in GameClass as well as clsSomething.
Whats going on?
I just want to be able to draw from other classes (preferably from the graphics object in GameClass). Or should I take another route and use AddHandler in GameClass to do the same, if so - can you please remind me how to use it? Heh I need to brush up my AddHandler skills.
-The Pentium Guy
-The Pentium Guy