startSetPixel

Syntax

void startSetPixel(int ctl)

Arguments

ctl
The control number of the Ownerdraw control on which you want to draw.

Description

Call startSetPixel before drawing on an OWNERDRAW control to select which control you will be drawing on. Use setPixel to change individual pixels or any of the Control drawing functions to draw to the control. After finished drawing, you must call endSetPixel to display the drawn control to the screen.

Example

%fml

ctl(1): OWNERDRAW(drawitem), Pos=(300,50), Size=(100, 100)

OnFilterStart: {

  // Maximum X/Y pixel co-ords of ownerdraw
  int maxxpixel = HDBUsToPixels(100)-1;
  int maxYpixel = VDBUsToPixels(100)-1;

  // Start using setPixel drawing on OWNERDRAW control 1
  startSetPixel(1);

  // Draw rectangle around OWNERDRAW area
  setLine(0, 0, maxxpixel, 0, RGB(0,0,0));
  setLine(0, 0, 0, maxYpixel, RGB(0,0,0));
  setLine(maxxpixel, 0, maxxpixel, maxYpixel, RGB(0,0,0));
  setLine(0, maxYpixel, maxxpixel, maxYpixel, RGB(0,0,0));

  // Fill a Rectangle in the OWNERDRAW set-pixel area
  setRectFill(10, 20, 30, 40, RGB(255, 0, 0));

  // Stop using setPixel drawing
  endSetPixel(1);

  return true;
}

See Also

endSetPixel, setPixel, setRectFill

Comments

Everyone can add their comments about their experiences with this function here. Tips for using it are welcome, too.