Aaand... now there's no way to get the width and height of the current graphics buffer, so I can't make a generalized function for drawing a multiply blended rectangle to the current buffer.
Blitzplus, why do you hate me so?
Ps:
the reason I need to know the width is so that I can automatically clip the rectangle to the edges of the image... Otherwise Blitz will crash if I specify a rectangle which is too large.
; ----------------------------------------------------------------------------------------------------------------------------------- ; This function draws a rectangle of the specified color using multiply blending to the current buffer. ; ----------------------------------------------------------------------------------------------------------------------------------- Function Draw_Rect(X1, Y1, X2, Y2, ColorR, ColorG, ColorB) Local LoopX, LoopY DestBuffer = GraphicsBuffer() LockBuffer(DestBuffer) For LoopY = Y1 To Y2 For LoopX = X1 To X2 RGB = ReadPixelFast(LoopX, LoopY, DestBuffer) R = (RGB Shr 16) And 255 G = (RGB Shr 8 ) And 255 B = (RGB ) And 255 R = R * (ColorR / 255.0) G = G * (ColorG / 255.0) B = B * (ColorB / 255.0) RGB = (R Shl 16) Or (G Shl 8) Or B WritePixelFast LoopX, LoopY, RGB, DestBuffer Next Next UnlockBuffer(DestBuffer) End Function
Blitzplus, why do you hate me so?
Ps:
the reason I need to know the width is so that I can automatically clip the rectangle to the edges of the image... Otherwise Blitz will crash if I specify a rectangle which is too large.