Go Back   RunUO - Ultima Online Emulation > RunUO > Utility Support > Ultima SDK

Ultima SDK Support for the Ultima SDK.

Reply
 
Thread Tools Display Modes
Old 05-21-2004, 06:44 AM   #1 (permalink)
Forum Novice
 
Join Date: Jun 2003
Age: 23
Posts: 134
Send a message via ICQ to [Shaman]
Default map.<facet>.GetImage()

i've been messing around with the ultima skd again, and i've stumbled upon an oddity:

Code:
Ultima.Map.Trammel.GetImage(x, y, 272, 272)
if i make a picturebox hold that image, giving x and y any random coordinate on the map... i get nothing but a black image.. same things go when i try one of the other facets...

Does anybody know why this doesn't work, and/or how to fix it?

Thanks
[Shaman] is offline   Reply With Quote
Old 05-21-2004, 12:21 PM   #2 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

Here's what i've done that makes it work:
Code:
pictureBox.Image = Ultima.Map.Felucca.GetImage(0, 0, 32, 32, true);
It just shows the water in the top left corner of the map though :P
The resolution there (32x32) isn't the right one to use to get

I recommend you lower your resolution though.. 272x272 shows like 1/4th of the map (takes quite a while to load)
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Old 05-21-2004, 12:51 PM   #3 (permalink)
Forum Novice
 
Join Date: Jun 2003
Age: 23
Posts: 134
Send a message via ICQ to [Shaman]
Default

Quote:
Originally Posted by Revan
Here's what i've done that makes it work:
Code:
pictureBox.Image = Ultima.Map.Felucca.GetImage(0, 0, 32, 32, true);
It just shows the water in the top left corner of the map though :P
The resolution there (32x32) isn't the right one to use to get

I recommend you lower your resolution though.. 272x272 shows like 1/4th of the map (takes quite a while to load)


i've been messing with it a bit, it clearly is that x and y aren't the .where of a character.. they are somehow linked i think, but i don't know how....

Krrios, do you have something that might clear this up?
[Shaman] is offline   Reply With Quote
Old 05-22-2004, 02:23 PM   #4 (permalink)
Forum Novice
 
Join Date: Jun 2003
Age: 23
Posts: 134
Send a message via ICQ to [Shaman]
Default

i found the sollution, it's not 100% accurate i think but it's close enough..

pictureBox.Image = Ultima.Map.Felucca.GetImage((x/8), (y/8), (picturebox1.width), (picturebox1.height), true);
[Shaman] is offline   Reply With Quote
Old 05-22-2004, 02:29 PM   #5 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

Can't you check if it's 100% accurate?
Coz i need it to be..
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Old 05-22-2004, 02:38 PM   #6 (permalink)
Forum Expert
 
TheOutkastDev's Avatar
 
Join Date: Sep 2002
Location: Houston, Texas
Age: 22
Posts: 3,933
Default

Why don't you just use the MapViewer Control thats on Arya's site?
TheOutkastDev is offline   Reply With Quote
Old 05-22-2004, 04:32 PM   #7 (permalink)
Forum Novice
 
Join Date: Jun 2003
Age: 23
Posts: 134
Send a message via ICQ to [Shaman]
Default

1) because i spent 5 hours trying to get that control on my form, and still failed(blame vs.net)
2) its 99% accurate, its just 1 or 2 pixels off, so its not such a biggy...

lemme paste the code i used:


Code:
    Private Sub show_img(ByVal x As Integer, ByVal y As Integer)
        Dim w As Integer = PictureBox1.Width * 0.75  ' <<< remove * 0.75 to make it not zoom
        Dim h As Integer = PictureBox1.Height * 0.75 ' <<< same
        Dim a As New Bitmap(w, h, Drawing.Imaging.PixelFormat.Format16bppRgb555)
        Dim img As Image = Ultima.Map.Felucca.GetImage(calc(x, w), calc(y, h), w, h, True)
        Dim graph As Graphics = Graphics.FromImage(a)
        Threading.Thread.Sleep(10)
        graph.DrawImage(img, New Point(0, 0))
        Threading.Thread.Sleep(10)
        PictureBox1.Image = a
    End Sub

    Public Function calc(ByVal coord As Integer, ByVal size As Integer) As Integer
        Return CInt((coord / 8) - ((size / 2) / 8))
    End Function

as you see i made it use the width/height of the picturebox you are using to make the coords you specified the center of the picturebox, in stead of the upper left corner...

you don't really need the threading.thread.sleep(10) in it, i used it to make it not lock up on me when im trying to generate the image
[Shaman] is offline   Reply With Quote
Old 05-22-2004, 04:34 PM   #8 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

1 pixel off = biggy*2
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Old 05-22-2004, 04:49 PM   #9 (permalink)
Forum Novice
 
Join Date: Jun 2003
Age: 23
Posts: 134
Send a message via ICQ to [Shaman]
Default

biggy*2 ? wtf i mean cmon its only 1 pixel... not like 1 screen or so :x

and again, its the "simple" sollution, if you want to make it perfect (and the map rotated like the ingame map..) you need to make your own things to do so
[Shaman] is offline   Reply With Quote
Old 05-22-2004, 04:58 PM   #10 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

lol
it's an application, not a person
called professionalism :P
Don't take it personally
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Old 05-22-2004, 04:59 PM   #11 (permalink)
Forum Novice
 
Join Date: Jun 2003
Age: 23
Posts: 134
Send a message via ICQ to [Shaman]
Default

i know, but my app doesn't need to be accurate, it just needs to show the general area (even without a dot saying where he is), so its not needed here
[Shaman] is offline   Reply With Quote
Old 05-22-2004, 05:29 PM   #12 (permalink)
 
Join Date: Sep 2002
Age: 20
Posts: 960
Send a message via ICQ to Revan Send a message via AIM to Revan Send a message via MSN to Revan
Default

well, in that case it doesn't matter :P
__________________
Can YOU RunUO?
Revan is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5