Author Topic: Wrong_Pixel_Color  (Read 1802 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Wrong_Pixel_Color
« on: April 03, 2013, 05:24:23 AM »
Deleted
« Last Edit: May 05, 2015, 11:36:37 AM by Peter »

Charles Pegge

  • Guest
Re: Wrong_Pixel_Color
« Reply #1 on: April 03, 2013, 09:04:13 AM »
Hi Peter,
A little brain teaser:

I assum the surface.pixels is a pixel array base pointer, and you are mapping pixels to it.

Function GetPixel(int x, y) as sys Export
    dword *pixel
    &pixel = screen.pixels   '&screen is already defined
    Return pixel[y*screen.w+x]
End Function


Function GetPixel(int x, y) as sys Export
    SDL_surface *surface
   &surface= ...  'need to obtain a surface handle from SDL
    dword *pixel
    &pixel = surface.pixels
    Return pixel[y*surface.w+x]
End Function

Emil_halim

  • Guest
Re: Wrong_Pixel_Color
« Reply #2 on: April 03, 2013, 10:33:27 AM »

Hi Peter ,

first of all you have to make check of your screen color format , E.g does it ARGB or RBG or BGRA ,etc.....

so Oxygen has no help here , i had have this problem when i was working with my libraries .

and you have correct the color format by yourself.