Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/16/2024 in all areas

  1. @Werty I updated Just check out the example _GDIPlus_BitmapApplyFilter_Indexed.au3. This time I added also a x64 DLL but not fully tested. The result should look like this here with Floyd-Steinberg dithering:
    2 points
  2. 10-15-2024 In Development The creative hiatus had ended and development in motion, see recent posts for updates. From 4-15-2024: I've severely pumped the brakes and come to a creative hiatus on the project and have returned to the drawing board on many aspects of RPGenerator, including, foremost, the graphics as well as the over all code used. The autoit concept demo that's currently available here is being discontinued due to many reasons that have led to this decision, based on various difficulties or my own dissatisfaction/frustrations with aspects of the project and where it stands. What's in the plans? Right now I'm developing a scriptable and modular IRC core software with Python, with this core software I plan to make the RPGenerator hub IRC bot (as mentioned previously, this part is still happening, but instead will be developed purely in python.) Autoit comes in with client programs for windows users which will be a user side chat client that features some completely redesigned graphics and is built to connect and interact with game hubs being hosted by the python bot. As far as the autoit side of this project is concerned, it has been scrapped and slated for a complete start over with autoit. Official production continuation of RPGenerator is planned to begin October 2024 I'm also migrating stuff and remodeling my 'brand' thru GitHub and Patreon, which will include software, other digital products/media, and maybe one day merch. Who knows. Do not worry, RPGenerator will be back and better than ever! Mode60 Official Website (m0de-60.github.io) Version 0.01 Concept (STILL AVAILABLE) DOWNLOAD: RPGenerator/windows-concept-game at main ยท m0de-60/RPGenerator (github.com)
    1 point
  3. Nine

    Read controlID from INI file

    Well since radio buttons are mutually exclusive, there is no need to write the state of all radios, you just want the one checked within each group. I believe OP wants to have multiple groups of radio buttons. So the ini file would list the one button checked within each group. I agree there is other ways to perform what OP wants, and using actual names is not the best.
    1 point
  4. Made changes to the main post of this thread (pretty much explaining what I did above). Also put more information on all my projects on the new website. Mode60 Official Website (m0de-60.github.io)
    1 point
  5. I put the image in a struct and looped the dither stuff, faster but no preview. #include <GDIPlus.au3> HotKeySet("{ESC}", "_exit") _GDIPlus_Startup() Global $Floyd[12] = [7, 3, 5, 1, 1, -1, 0, 1, 0, 1, 1, 1] Global $Image = _GDIPlus_BitmapCreateFromFile("graytest.png") Global $Width = _GDIPlus_ImageGetWidth($Image), $Height = _GDIPlus_ImageGetHeight($Image) $Gui = GUICreate("Floyd-Steinberg Dithering", $Width, $Height) GUISetState() $Graphics = _GDIPlus_GraphicsCreateFromHWND($Gui) _GDIPlus_GraphicsDrawImageRect($Graphics, $Image, 0, 0, $Width, $Height) $Bitmap1 = _GDIPlus_BitmapLockBits($Image, 0, 0, $Width, $Height, BitOR($GDIP_ILMWRITE, $GDIP_ILMREAD), $GDIP_PXF32ARGB) $Pixels1 = DllStructCreate("dword[" & $Width * $Height & "];", DllStructGetData($Bitmap1, "Scan0")) $floatstruct = DllStructCreate("float") $dwordstruct = DllStructCreate("dword", DllStructGetPtr($floatstruct)) ;AARRGGBB to float For $y = 0 To $Height - 1 $RowOffset = $y * $Width + 1 For $x = 0 To $Width - 1 $oldPixel = Dec(Hex(DllStructGetData($Pixels1, 1, $x + $RowOffset), 2)) / 255 DllStructSetData($floatstruct, 1, $oldPixel) ;write into float struct $oldPixel = DllStructGetData($dwordstruct, 1) ;read as dword (aka "pixel" AARRGGBB) DllStructSetData($Pixels1, 1, $oldPixel, $x + $RowOffset) ;store the float number as "pixel" AARRGGBB Next Next For $y = 0 To $Height - 1 $RowOffset = $y * $Width + 1 For $x = 0 To $Width - 1 $oldpixel = DllStructGetData($Pixels1, 1, $x + $RowOffset) DllStructSetData($dwordstruct, 1, $oldPixel) ;write into dwordstruct (place of floatstruct) $oldPixel = DllStructGetData($floatstruct, 1) ;read float $newpixel = ($oldpixel <= 0.5) ? 0:1 DllStructSetData($Pixels1, 1, "0xFF" & Hex($newpixel * 255, 2) & Hex($newpixel * 255, 2) & Hex($newpixel * 255, 2), $x + $RowOffset) $quant_error = $oldPixel - $newpixel ;-------Floyd-Steinberg For $Loop = 0 To 3 $pixel = DllStructGetData($Pixels1, 1, ($x + $Floyd[$Loop+4]) + ($y + $Floyd[$Loop+8]) * $Width + 1);get pixel integer/DWORD AARRGGBB DllStructSetData($dwordstruct, 1, $pixel) ;set into DWORD struct $col = DllStructGetData($floatstruct, 1) ;read float from DWORD $float = $col + ($Floyd[$Loop] / 16 * $quant_error) ;calculate with float DllStructSetData($floatstruct, 1, $float) ;write into float struct $pixel = DllStructGetData($dwordstruct, 1) ;get dword from float and DllStructSetData($Pixels1, 1, $pixel, ($x + $Floyd[$Loop+4]) + ($y + $Floyd[$Loop+8]) * $Width + 1) ;write the "float" as a "pixel" Next Next Next _GDIPlus_BitmapUnlockBits($Image, $Bitmap1) _GDIPlus_GraphicsDrawImageRect($Graphics, $Image, 0, 0, $Width, $Height) While GUIGetMsg <> -3 Sleep(10) WEnd Func _exit() Exit EndFunc
    1 point
×
×
  • Create New...