|
||
|
|
#1 (permalink) |
|
Forum Novice
|
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) Does anybody know why this doesn't work, and/or how to fix it? Thanks |
|
|
|
|
|
#2 (permalink) |
|
Here's what i've done that makes it work:
Code:
pictureBox.Image = Ultima.Map.Felucca.GetImage(0, 0, 32, 32, true); 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? |
|
|
|
|
|
|
#3 (permalink) | |
|
Forum Novice
|
Quote:
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? |
|
|
|
|
|
|
#7 (permalink) |
|
Forum Novice
|
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|