You are using pixel_to_bmap wrong. The signature is
Code:
pixel_to_bmap(BMAP* bmap,var x,var y,var pixel);



You are passing the coordinates first, then the bitmap, then the pixel value. Look at my code:

Code:
#include <acknex.h>
#include <default.c>

int main ()
{
    wait(3);
    
    int bmapWidth = 8;
    int bmapHeight = 8;

    // drawing a red bitmap with a half-yellow pixel
    BMAP* b = bmap_createblack(bmapWidth, bmapHeight, 8888);
    if (b != NULL)
    {
        bmap_fill(b, vector(0,0,255), 100);
    
        var f = bmap_lock(b, 0);
        if (f > 0)
        {
            var p = pixel_for_vec(vector(0, 255, 255), 50, f);
            pixel_to_bmap(b, 3, 3, p);
            bmap_unlock(b);
        }
        else
            error("hehehe... there is a bitmap - but it can't be locked. Hihihi.");
    }
    else
        error("no bitmap was created. Damn.");
        
    float bmapScale = 32.0;
        
    if (b != NULL)
    {
        PANEL* p = pan_create("", 0);
        if (p != NULL)
        {
            p->bmap = b;
            p->size_x = b->width;
            p->size_y = b->height;
            p->scale_x = p->scale_y = bmapScale;
            
            p->flags = SHOW;
        }
        else
            error("no panel was created. Damn.");
    }
    else
        error("no bitmap is there.... grrrr!");
}



Last edited by HeelX; 08/19/12 21:33.