Sign in to follow this  
Followers 0
kiboost

tga files into gui

15 posts in this topic

#1 ·  Posted (edited)

Hi,

Seems gdi+ doesn't read tga (8bits tga without alpha).

I'm writing a 64bits script that list some directories containing some tga file sequences, and I would like to show one of these tga into my gui.

Any idea how to get that ?

What would rocks would be to also be able to display 32bit rgba exr files.

Edited by kiboost

Win7 pro x64. scripts compiled to x64. - Autoit v3.3.6.1 | Scite 1.79

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

No, GDI+ cannot load TGA files. If you have knowledge in C++ you can try to convert the code from here http://www.dhpoware.com/source/bitmap.html to AutoIt (no RLE supported)!

I'm just working on the bool Bitmap::loadTarga(LPCTSTR pszFilename) function but my C++ skill is near zero...

If somebody feels free to convert it please post it into this forum!

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I made a DLL out of this code to load targa files to hBitmap. Hope this is useful and works as expected.

Edited by funkey
1 person likes this

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

Thanks funkey, but seems you just convert the tga to bmp before showing it.

I use cmd line nconvert tools to do this into jpg and use guictrlcreatepic, works also. But native handle of tga, png, exr (16 and 32bits) would really help a lot.


Win7 pro x64. scripts compiled to x64. - Autoit v3.3.6.1 | Scite 1.79

Share this post


Link to post
Share on other sites

Sample code just makes a bitmap from targa file. But you receive a hBitmap and you can do everything you want with it.


Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

I made a DLL out of this code to load targa files to hBitmap. Hope this is useful and works as expected.

Hi funkey,

somehow I sensed it that you will do it. ;) Is there any chance to do it completely in AutoIt without using the DLL? I started the conversation but I still stuck on understanding some commands in C++.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Hi UEZ, it should be no problem to do this in AutoIt. I will have a look at it when I have time. Not sure if this happens this year or not.


Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

Does it do it instantely in memory ? Would be better than converting into hard file !


Win7 pro x64. scripts compiled to x64. - Autoit v3.3.6.1 | Scite 1.79

Share this post


Link to post
Share on other sites

All in memory, writing file to disk is just an example.


Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

Hello,

now I managed to convert the code to AutoIt. I hope there are not to much errors in it.

It is not that fast, but i think some improvements could be done.

Best regards

funkey

1 person likes this

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

I made a DLL out of this code to load targa files to hBitmap. Hope this is useful and works as expected.

I got DLL error: 1

I also see it is 32bit, could it work in 64bit mode ?


Win7 pro x64. scripts compiled to x64. - Autoit v3.3.6.1 | Scite 1.79

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

The DLL version crashes (AutoIT3.exe ended.rc:-1073741819) also on my machine (Win7 x64) but the 2nd pure AutoIt code works properly! :thumbsup:

Btw, can you provide the DLL code?

For transparent images the black background is ugly but can be changed easily!

I will analyse your code to understand the conversation from C++ to AutoIt...

Thank you very much!

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

So, now you can download all I have about this. I cleaned some things in the DLL also.

tga.rar

4 people like this

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

Thanks a lot!

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0