Valhalla Legends Forums Archive | Battle.net Bot Development | Getting Image from .bni FIle

AuthorMessageTime
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.
May 13, 2004, 5:40 AM
Maddox
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.
May 13, 2004, 6:26 AM
Myndfyr
[quote author=Maddox link=board=17;threadid=6782;start=0#msg59953 date=1084429581]
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.
[/quote]

That was a really-well written response Maddox. Good help! :)
May 13, 2004, 8:34 AM
LoRd
Documentation on converting icons.bni to a targa can be found here.
May 13, 2004, 3:22 PM
Spht
[quote author=TheNewOne link=board=17;threadid=6782;start=0#msg59946 date=1084426824]
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.
[/quote]

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.
May 13, 2004, 3:31 PM
Maddox
[quote author=Myndfyre link=board=17;threadid=6782;start=0#msg59957 date=1084437273]
[quote author=Maddox link=board=17;threadid=6782;start=0#msg59953 date=1084429581]
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.
[/quote]

That was a really-well written response Maddox. Good help! :)
[/quote]

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.
May 14, 2004, 1:10 AM
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
May 14, 2004, 1:18 AM
Zeller
[quote author=Myndfyre link=board=17;threadid=6782;start=0#msg59957 date=1084437273]
[quote author=Maddox link=board=17;threadid=6782;start=0#msg59953 date=1084429581]
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.
[/quote]

That was a really-well written response Maddox. Good help! :)
[/quote]

What happened to the karma system that used to be on these boards?
May 14, 2004, 2:00 AM
BinaryzL
I am having trouble loading the image into a picture box.

[code]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[/code]

[code]Private Type pixeldat
PacketHeader As Byte
Blue As Byte
Green As Byte
Red As Byte
End Type[/code]

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

Search