• Welcome to Valhalla Legends Archive.
 

Getting Image from .bni FIle

Started by TheNewOne, May 13, 2004, 12:40 AM

Previous topic - Next topic

TheNewOne

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.

Maddox

#1
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.
asdf.

MyndFyre

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! :)
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Eric

Documentation on converting icons.bni to a targa can be found here.

Spht

#4
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.

Maddox

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.
asdf.

TheNewOne

!! 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

Zeller

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?

BinaryzL

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.

UserLoser.

#9
You have to decompress the TGA (can probably find some function off Google to do this)

BinaryzL

#10
Alright thanks, if anyone has this code for vb can you please post it?