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

Ultima SDK Support for the Ultima SDK.

Reply
 
Thread Tools Display Modes
Old 11-18-2006, 02:54 AM   #1 (permalink)
Forum Novice
 
rsmiller21's Avatar
 
Join Date: Feb 2005
Location: Stephenville, Tx
Age: 25
Posts: 225
Send a message via ICQ to rsmiller21 Send a message via MSN to rsmiller21
Default A Simple Ultima.dll Code Tutorial

Below I decided to place some code that will help anyone interested pull common data from the dll. This code is written in Visual Basic but can be easily converted to C# with little effort.

** In order to use Ultima.dll you must add the file as a reference in your VB/C# project. Do a google search for "visual basic add file reference" if you are unsure how to do this. **

Displaying a Gump Image

Code:
Dim gumpImg As Image 
Dim gump As Ultima.Gumps 
 
' Ultima.dll returns the gump image 
gumpImg = gump.GetGump(463) ' Use the Gump ID you need in place of 463 
 
' Make a picture box display the image 
PictureBox1.Image = gumpImg


Displaying a Item Image

Code:
Dim staticImg As Image 
Dim item As Ultima.Art 
 
' Ultima.dll returns the static image 
staticImg = item.GetStatic(463) ' Use the Static ID you need in place of 463 
 
' Make a picture box display the image 
PictureBox1.Image = staticImg


Adding Hues to Images

Code:
Dim gumpImg As Image 
Dim gump As Ultima.Gumps 
Dim hue As Ultima.Hue ' Used to store a hue 
Dim hues As Ultima.Hues ' Used to get hue data 
 
' Ultima.dll returns the gump image 
gumpImg = gump.GetGump(463) ' Use the Gump ID you need in place of 463 
 
' Make a picture box display the image 
PictureBox1.Image = gumpImg 
 
' Loads hue data 
hue = hues.GetHue(1454) 
 
' Applys hue data to the image 
hue.ApplyTo(gumpImg, False) ' Second param is for grey scaling

That should get you by a majority of problems one will face while using the Ultima.dll. Good luck and happy programming.
rsmiller21 is offline   Reply With Quote
Old 11-19-2006, 07:48 AM   #2 (permalink)
Forum Expert
 
Join Date: Oct 2002
Age: 45
Posts: 4,372
Default

Thanks! Its always nice to see some code examples for the DLL.
HellRazor is offline   Reply With Quote
Old 11-11-2007, 05:58 PM   #3 (permalink)
Forum Expert
 
Marak's Avatar
 
Join Date: Mar 2005
Location: Firmly Seated Infront of the Computer.
Age: 25
Posts: 429
Default

Yes very nice thankyou, definatly using those for the new script creator
__________________


Quote:
****** says: afk need to smoke this joint i rolled
Marak Says: :eek: .... that explains so much about your coding!
Marak 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