Vorph Posted December 27, 2022 Posted December 27, 2022 Hello, I recently started to create a VERY simply Launcher Utility for DOOM (yes, the old one) that fit's my needs and is not bloated with features I don't need. I got a bit of experience with AutoIT and I decided to give it a shot. The launcher itself works fine - it lacks a minor feature: displaying the Titlescreen. The overall plan is to extract the image information from the WAD file and store the image in SQLite database to be ultimately capable of showing it in the GUI. I created a au3 that is able to fetch the required data from WAD file and store it as an image file to HDD (i.e. jpg file). I used the _GDIPlus_BitmapCreateFromScan0 and _GDIPlus_BitmapSetPixel commands to create the image. Now I'm stuck 😕 I can save the image to a file using _GDIPlus_ImageSaveToFile but I would like to skip this step and Step1: display the image directly in my GUI Step2: store the binary data as BLOB in SQLITE and display the image after reading Any help is appreciated... especially regarding Step1 WAD.au3 bbb.au3
Solution genius257 Posted January 8, 2023 Solution Posted January 8, 2023 Hi @Vorph. Step 1: So the issue with drawing the image on the graphics object is simply an issue with your alpha channel. In your WAD_ReadPictureV1 and WAD_ReadPictureV2 you use GDIP_PXF32ARGB, yet when you assign pixel colors with _GDIPlus_BitmapSetPixel your $palette array holds only RGB info, so the alpha value is 0x00 (for example: 0x008B0000) so when drawing to anything that supports the alpha channel nothing is shown because the pixels are fully transparent. The quick fix is to change GDIP_PXF32ARGB to GDIP_PXF32RGB in your functions. I would like to help with step 2, but it is currently very late 😅 Storing BLOB in SQLite, extracting it and using it with a bitmap object is not that difficult, but time consuming to make a working example, so if i have time another time and you havent solved it, I might make some example code for you Hope i helped somewhat. Gianni 1 To show your appreciation My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser
Vorph Posted January 11, 2023 Author Posted January 11, 2023 Many, many thanks... this did the trick. I temporary got around the issue by converting the image to a stream and back (without actually knowing the reason). The bit regarding SQLite is already working.
SOLVE-SMART Posted January 11, 2023 Posted January 11, 2023 Hi @Vorph, 10 minutes ago, Vorph said: [...] The bit regarding SQLite is already working. [...] So your second question, "Step 2" is already solved? No further help needed? Best regards Sven ==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now