Jump to content

Socrathes

Members
  • Posts

    13
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Socrathes's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I had already thought about that, but i thought there might be a prefabricated very fast function. For example with "_GDIPlus_ImageAttributesSetThreshold" and "_GDIPlus_ImageAttributesSetRemapTable" you can already create a pure black/white image. However, the relevant pixels would have to become completely white and I would like to have the option to colorize the relevant pixels according to my own wishes. Of course with "_GDIPlus_BitmapUnlockBits" you could put this together somehow, but it would be a bit time consuming and I was hoping that maybe a better solution already exists. as it looks there seems to be no good ready solution, then I'll probably have to do the work
  2. "_GDIPlus_BitmapSetPixel,_GDIPlus_BitmapGetPixel" is very slow, "colortable" makes no sense for the non-relevant pixels because there can be too many different pixels and they are not always the same. the whole thing is also not limited to 100x100 pixels as with p0 and p1 it is just an example. i was thinking more of new handle with 100x100 white pixel and then put the relevant pixel over it (transparency)?
  3. #include <GDIPlus.au3> Example() Func Example() Local $hImage1, $hGraphics Local Const $iWidth = 100, $iHeight = 100 ; Initialize GDI+ library _GDIPlus_Startup() $hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\p0.bmp") ; Draw one image in another $hGraphics = _GDIPlus_ImageGetGraphicsContext($hImage1) Local $aRemapTable[4][2] $aRemapTable[0][0] = 3 $aRemapTable[1][0] = 0xFF2D1200 ;Old Color1 $aRemapTable[1][1] = 0xFF000000 ;New Color1 $aRemapTable[2][0] = 0xFF491D00 ;Old Color2 $aRemapTable[2][1] = 0xFF000000 ;New Color2 $aRemapTable[3][0] = 0xFF381600 ;Old Color3 $aRemapTable[3][1] = 0xFF000000 ;New Color3 Local $hIA = _GDIPlus_ImageAttributesCreate() _GDIPlus_ImageAttributesSetRemapTable($hIA, $aRemapTable) _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hImage1, 0, 0, $iWidth, $iHeight, 0, 0, $iWidth, $iHeight, $hIA) ; Save resultant image _GDIPlus_ImageSaveToFile($hImage1, @ScriptDir & "\p1.bmp") ; Clean up resources _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_ImageDispose($hImage1) ; Shut down GDI+ library _GDIPlus_Shutdown() EndFunc ;==>Example https://i.postimg.cc/ZYXCH5MQ/p0.png https://i.postimg.cc/0jS5F7BB/p1.png Hello, Is there a quick way to use "gdi" to convert the image "p0.bmp" to "p1.bmp"? With "_GDIPlus_ImageAttributesSetRemapTable" I could convert the relevant pixels to the desired color. Now I just need a quick function to replace the remaining non-relevant pixels with white "0xFFFFFFFF". thanks in advance p1.bmp p0.bmp
  4. this is exactly what happened, what can be done about it
  5. strangely, "arraysort" did not work for my array with 1000 entries. it works with this test array😅
  6. "arraysort would do fine but i have not managed to sort in ascending order with it.
  7. Hello, #include <array.au3> Global $test[4][3] = [["Jax",100,3],["Jade",50,1],["Jaquie",70,0],["Sonya",80,2]] _ArrayDisplay($test) Is there a quick way of sorting the array in ascending order with the values from column three? thanks in advance
  8. thanks for that of course that makes sense. now the only question would be whether there is a possibility with which one can query the exact number of entries, or must a function be written for that?
  9. thank you but that would only work if all rows had three columns? but here three rows have two columns and the searched row has three columns. this would also be only an example it could be that all columns have completely different lengths, then I cannot work with the maximum value.
  10. hello Local $a = [[3,39],[2,36,37],[0,38],[1,40]] is there a way to find out the number of elements of the 2d array. with ubound i get number of rows but not number of elements in the 2 level. thanks in advance
×
×
  • Create New...