Ruins of Hell Posted December 3, 2009 Author Share Posted December 3, 2009 Well, I tried to change a picture box based on the map, but I get 424 error Object Required.Here's my code, in Form_Load():``` Me.Map.Picture = "\GUI\Maps\" & GetPlayerMap(1) & ".png"```Yes the file exists, but it still doesn't work… Link to comment Share on other sites More sharing options...
Robin Posted December 3, 2009 Share Posted December 3, 2009 Wtf is:```Me.Map.Picture```Name your controls properly. You don't need "Me." if the code is on the same form as the control is.Also, you can't just directly try and load a PNG file without converting it. Link to comment Share on other sites More sharing options...
Ruins of Hell Posted December 3, 2009 Author Share Posted December 3, 2009 @Robin:> Wtf is:```> Me.Map.Picture> ```> Name your controls properly. You don't need "Me." if the code is on the same form as the control is.> > Also, you can't just directly try and load a PNG file without converting it.When I try to remove it I get an error, so I'll just keep it.If by converting it, you mean changing the file type, then I've tried .bmp too, no dice. Link to comment Share on other sites More sharing options...
Tdogthedog Posted December 3, 2009 Share Posted December 3, 2009 soul now i can rescue you!! lol i found this for you…```Picture1.Picture = LoadPicture(App.Path & "\somepicture.jpg")``` Link to comment Share on other sites More sharing options...
Ertzel Posted December 3, 2009 Share Posted December 3, 2009 Well what Frm do you have the picturebox in, and whats the name of the picturebox you want to display.. Also why is it GetPlayerMap(1), The code to find a players map in the Client is GetPlayerMap(MyIndex)Also just .Picture is for the background im pretty sure.And``` = "\GUI\Maps\" & GetPlayerMap(1) & ".png" ```would not be the proper format to load the picture.I think it should be ``` = LoadPicture(App.path & "\GUI\Maps" & GetPlayerMap(MyIndex) & ".bmp" & Ending)```Then it would go in modHandleData under```Public Sub Packet_PlayerData(ByRef Parse() As String)```Once you give me the name of the frm you want to load it in (Im guessing its frmMirage or frmStable if its the gamegreen you want to load it on) and the name of the PictureBox you want it to load on, then I can fill in the rest. Link to comment Share on other sites More sharing options...
Ruins of Hell Posted December 3, 2009 Author Share Posted December 3, 2009 @[SB:> Ertzel link=topic=54909.msg581553#msg581553 date=1259884467]> Well what Frm do you have the picturebox in, and whats the name of the picturebox you want to display.. Also why is it GetPlayerMap(1), The code to find a players map in the Client is GetPlayerMap(MyIndex)> Also just .Picture is for the background im pretty sure.> > And```> = "\GUI\Maps\" & GetPlayerMap(1) & ".png" > ```> would not be the proper format to load the picture.> I think it should be ```> = LoadPicture(App.path & "\GUI\Maps" & GetPlayerMap(MyIndex) & ".bmp" & Ending)> ```> Then it would go in modHandleData under> ```> Public Sub Packet_PlayerData(ByRef Parse() As String)> ```> Once you give me the name of the frm you want to load it in (Im guessing its frmMirage or frmStable if its the gamegreen you want to load it on) and the name of the PictureBox you want it to load on, then I can fill in the rest.Just found that out, and there's a reason why I don't want it to load for MyIndex. Link to comment Share on other sites More sharing options...
Tdogthedog Posted December 4, 2009 Share Posted December 4, 2009 i figured out your solution.. your trying to find the player map then taking a picture. So your problem is .. but this is just my opinon.. but vb cant read code then desplay a picture.. but what you can do is make screen shots of the map store it in a folder then have vb call that picture… not sure if thats what your doing but.. yea.. Link to comment Share on other sites More sharing options...
balliztik1 Posted December 4, 2009 Share Posted December 4, 2009 That is what he's doing. He's not loading a map. He's loading a file named "#.bmp" where the number is the map number. Try this```Map.Picture = LoadPicture App.path & "\GUI\Maps\" & CStr(GetPlayerMap(1)) & ".bmp"```Assuming that the folder is called "Maps" and the file is "#.bmp", which I figured is the case, this should work. If not, then the folder is "GUI" and the file is "Maps#.bmp", which is what you already had. Dunno if that's what you were trying to do. Link to comment Share on other sites More sharing options...
Robin Posted December 4, 2009 Share Posted December 4, 2009 @Tdogthedog:> i figured out your solution.. your trying to find the player map then taking a picture. So your problem is .. but this is just my opinon.. but vb cant read code then desplay a picture.. but what you can do is make screen shots of the map store it in a folder then have vb call that picture… not sure if thats what your doing but.. yea..You fail at logic.Soul, we can't bloody help you because we don't know what you're trying to do. Link to comment Share on other sites More sharing options...
Ertzel Posted December 4, 2009 Share Posted December 4, 2009 Tell us the name of the frm the picture is one, and the name of the picture box and then we can tell you how to code it.The code I posted is what you need to use, its just not the full code because you posted random information thats not what is needed to finish the code. Link to comment Share on other sites More sharing options...
Ruins of Hell Posted December 5, 2009 Author Share Posted December 5, 2009 I fixed this already :/ Ertzel had it right with the LoadPicture. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now