Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Technology & Software 2 years ago
Posted on 16 Aug 2022, this text provides information on Technology & Software related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I'm working with Via Builder, from Inscriber Technology. This app merges a TGA sequence animation into one single .via file, making it much better to load large sequences, as this file is optimized. There are plugins to use this with some Adobe products.
I'm working on Delphi, and my problem is that I can't get back the original alpha channel from the frames. Using their VIACODECLib_TLB library, I have the following function:
function GetFrameBitmap(Frame: Integer): Integer;
from tha IViaFile interface. This function is supposed to return a handle to a frame bitmap from the original sequence. The following code could work:
viaObject: IViaFile; bmp: TBitmap; index: Integer; bmp.Handle := ViaObject.GetFrameBitmap(index);
But the resulting bitmap is the original frame with no alpha channel. Actually, its alpha channel is zero for the entire image.
Assuming I was doing something wrong, I tried using the GetDIBits function, to be sure there was an alpha channel somewhere. So I allocated memory long enough to store the bitmap assuming it had 4 channels and used the GetDIBits function. I got the same result as before: normal frame, alpha channel zero for the entire image.
Just to note, Inscriber (whose forums are dead), claims that its Via Builder has full alpha support. I know someone who managed to load the frames correctly, on C++, using the GetDIBits function, but "translating" the code to Delphi didn't work.
Any help would be much appreciated.
Thank you.
I suggest you take a closer look at your colleague's C++ code that supposedly com/tag/works">works. You probably missed some com/tag/detail">detail. How much of the code was Windows API, and how much of it was some vendor-specific graphics code? The API stuff should be a cinch to translate to Delphi.
You might find that Delphi's TBitmap class doesn't support transparency, so you would need to use some other graphic-support library instead of plain old GDI. But if you're fetching the raw bitmap data as with GetDIBits, you should at least be able to see that the alpha-channel data is there. (You'd still need to find a way of displaying the bitmap properly, but at least you'd know you had the right data to start with.)
TBitmap
GetDIBits
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 9 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.