Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: TheNewOne on May 13, 2004, 12:40 AM

Title: Getting Image from .bni FIle
Post by: TheNewOne on May 13, 2004, 12:40 AM
Ok ive been also doign research on .bni files which i saw a few posts about and i was wondering how one would contruct a image from a .bni file. If anyone has any ideas they would be much appreciated. Yet again maybe not helpful but my bot is in vb.
Title: Re:Getting Image from .bni FIle
Post by: Maddox on May 13, 2004, 01:26 AM
You'll need an owner draw listbox. You convert the targa image into a bitmap, select it in a compatible dc using SelectObject(), and draw an icon to your listbox which depends on the user flags and product.
Title: Re:Getting Image from .bni FIle
Post by: MyndFyre on May 13, 2004, 03:34 AM
Quote from: Maddox on May 13, 2004, 01:26 AM
You'll need an owner draw listbox. You convert the targa image into a bitmap, select it in a compatible dc using SelectObject(), and draw an icon to your listbox which depends on the user flags and product.

That was a really-well written response Maddox.  Good help! :)
Title: Re:Getting Image from .bni FIle
Post by: Eric on May 13, 2004, 10:22 AM
Documentation on converting icons.bni to a targa can be found here (http://linkware.clan-mac.com/kanebot/misc/bni_file.shtml).
Title: Re:Getting Image from .bni FIle
Post by: Spht on May 13, 2004, 10:31 AM
Quote from: TheNewOne on May 13, 2004, 12:40 AM
Ok ive been also doign research on .bni files which i saw a few posts about and i was wondering how one would contruct a image from a .bni file. If anyone has any ideas they would be much appreciated. Yet again maybe not helpful but my bot is in vb.

A BNI file is simply a Targa file with an added header to specify the coordinates of each individual icon and how to use them.  You never specified what type of image you want to convert it to, but if you want to make a valid TGA file from the BNI, then you can just remove the header.  If you want to save it as a different format, then I suggest you search for a documentation for the format you want to use.
Title: Re:Getting Image from .bni FIle
Post by: Maddox on May 13, 2004, 08:10 PM
Quote from: Myndfyre on May 13, 2004, 03:34 AM
Quote from: Maddox on May 13, 2004, 01:26 AM
You'll need an owner draw listbox. You convert the targa image into a bitmap, select it in a compatible dc using SelectObject(), and draw an icon to your listbox which depends on the user flags and product.

That was a really-well written response Maddox.  Good help! :)

Meh I was about to go to bed and didn't feel like writing a detailed response. I probably shouldn't have responded at all.
Title: Re:Getting Image from .bni FIle
Post by: TheNewOne on May 13, 2004, 08:18 PM
!! you guys are gods. Always giving me the answers I exactly need for my problem. Im sorry for asking so many things but im tryign to learn. Thanks for the support
Title: Re:Getting Image from .bni FIle
Post by: Zeller on May 13, 2004, 09:00 PM
Quote from: Myndfyre on May 13, 2004, 03:34 AM
Quote from: Maddox on May 13, 2004, 01:26 AM
You'll need an owner draw listbox. You convert the targa image into a bitmap, select it in a compatible dc using SelectObject(), and draw an icon to your listbox which depends on the user flags and product.

That was a really-well written response Maddox.  Good help! :)

What happened to the karma system that used to be on these boards?
Title: Re:Getting Image from .bni FIle
Post by: BinaryzL on May 15, 2004, 11:04 PM
I am having trouble loading the image into a picture box.

Dim intH As Integer, intW As Integer
   For intH = TGAHeader.Height To 0 Step -1
       For intW = 0 To TGAHeader.Width Step 1
           Get #1, , PixelData
           Picture1.PSet (intW, intH), RGB(PixelData.Red, PixelData.Green, PixelData.Blue)
       Next intW
   Next intH


Private Type pixeldat
   PacketHeader As Byte
   Blue As Byte
   Green As Byte
   Red As Byte
End Type


I am 85% sure all my other types are loaded with the right data but the picture is jargled.
Title: Re:Getting Image from .bni FIle
Post by: UserLoser. on May 15, 2004, 11:06 PM
You have to decompress the TGA (can probably find some function off Google to do this)
Title: Re:Getting Image from .bni FIle
Post by: BinaryzL on May 16, 2004, 11:18 AM
Alright thanks, if anyone has this code for vb can you please post it?