Jump to content

Problems with GDIPlus and GUI


Go to solution Solved by genius257,

Recommended Posts

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

Link to post
Share on other sites
  • 2 weeks later...
  • Solution

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.

Link to post
Share on other sites

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.

 

Link to post
Share on other sites

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

Stay innovative!

Spoiler

🌍 Au3Forums

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔍 Forum search

🔮 Me on GitHub

💬 Opinion about new forum sub category

 📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...