Jump to content

Search the Community

Showing results for tags '_winapi_createdib'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I want to take some images and bring their bits down from 32 bits to 8bits(256 colors) and 4 bits (16 colors) searching around for color data, it was easy to get the 4 bits color data and to add it to an array and use the color table $aColorTable= stringsplit('0-8388608-16711680-16711935-32896-32768-65280-65535-128-8388736-255-12632256-8421504-8421376-16776960-16777215','-',3) ; Create color table from an array of colors Local $tColorTable = _WinAPI_CreateDIBColorTable($aColorTable) ; Create 8 bits-per-pixel device-independent bitmap (DIB) and retrieve a pointer to the location of its bit values $hBitmap = _WinAPI_CreateDIB($iWidth, $iHeight, 4, $tColorTable, 16) the result is the same as if i take mspaint load any image and save as 16 colors(4bits) however with the 256 color or 8 bit the data i found are not the same, there are multiple color tables i tested, the colors are off, i even found some scripts in the forum that generate 8 bit color tables but the colors are also off, they are not the same as if i take mspaint and save an image as 256 colors, if done with mspaint the colors are very acculturate, i thought well maybe get the color table from an 8 bit image i have that was done with mspaint, but im not sure how to do that, below i tried something but not sure if it gets the table and i don't know how to get the table to an array #include <WinAPIGdi.au3> #include <WinAPIRes.au3> Global $hBitmap = _WinAPI_LoadImage(0, 'D:\spectrum256.bmp', $IMAGE_BITMAP, 0, 0, $LR_LOADFROMFILE+$LR_CREATEDIBSECTION ) Local $tSIZE = _WinAPI_GetBitmapDimension($hBitmap) Local $iWidth = DllStructGetData($tSIZE, 'X') Local $iHeight = DllStructGetData($tSIZE, 'Y') ConsoleWrite('size= '&$iWidth&' '&$iHeight&@CRLF) $table = _WinAPI_GetDIBColorTable ( $hBitmap) ConsoleWrite(' Error '&@error & @CRLF) ConsoleWrite(' Extended '&@extended & @CRLF) ;_WinAPI_GetDIBits?
×
×
  • Create New...