[Solved] Writepixels argb() method not working

Monkey Forums/Monkey Beginners/[Solved] Writepixels argb() method not working

Pakz(Posted 2014) [#1]
I could not get it working to draw certain colors to a image. I found a argb function on the blitz site and converted it to monkey. But it only shows a black screen.

I modified a working example from this forum that worked but it did not show how to draw using set colors.

I hope someone can show me a working argb method that I can use to draw pixels to an image. I wish to create images from data statements(arrays) and also using a couple of rgb colors and transparent pixels to.




Gerry Quinn(Posted 2014) [#2]
Your alpha is zero, so the image is transparent.

You might want to change the argb function so that the default alpha is 255.


Pakz(Posted 2014) [#3]
I changed it and it is still not working. When I set the int value in the pixel array to a other value nothing is drawn either, I hae no idea what is going on,

My laptop is doing a virus scan and is very slow atm. It takes a couple of minutes to load a page :)


Pakz(Posted 2014) [#4]
I found the error

The or needed to be the | character.




Gerry Quinn(Posted 2015) [#5]
Heh, I never spotted that! I usually use hex for colours myself (e.g. red = $FFFF0000), or it would probably have stood out more.


Pakz(Posted 2015) [#6]
Can you just assign hex into integer variables and then write pixels with that?


Pakz(Posted 2015) [#7]
I was not on my laptop, but on my ipad so I could not check. I was watching Manchester United on the tv.

I checked now and see that you can assign hex values to variables(integers) using int = $hexvalue

The assignement of colors is : $alpha(00-FF)red(00-FF),green(00-FF),blue(00-FF)