Hi all, thanks for reading this.
Here's the deal: I'm making an application that draws random figures on a random form using random styles sizes and everything. Just for the fun of it. Big fan of pretty colors hahaha.
Here's my first question, I'm using the RGB format to generate the colors by using Random(255) three times and then I convert it to a TColor using the RGB method provided by Borland. Now if I want to exact opposite color I do this:
But somehow this seems off to me, for example if the original color was a kind of green then it will result in a brownish color for the negative color, it just doesn't seem right to me, can anyone shed any light on this?
Second question: At first I was using TPaintBox but for some reasom it wouldn't show the TPen.Style (anyone know why that is btw?) that was applied so now I just directly draw to the Self.Canvas. But for some reason if I draw for example 10 figures and something pops over it, it will only show the last drawn figure when the form is on top again. Can anyone explain to me how I can make it remember all 10 drawings?
I suppose I could use CopyRect to copy it to a bitmap and then re-apply it using the Form's OnShow event but I feel I shouldn't have to do that (if it even works, haven't tried yet).
Thanks for reading my questions, bigger thanks if you bother with answering them ;-)
BobbaFet
Here's the deal: I'm making an application that draws random figures on a random form using random styles sizes and everything. Just for the fun of it. Big fan of pretty colors hahaha.
Here's my first question, I'm using the RGB format to generate the colors by using Random(255) three times and then I convert it to a TColor using the RGB method provided by Borland. Now if I want to exact opposite color I do this:
Code:
function NegativeColor(R,G,B: byte): TColor;
begin
R := 255 - R;
G := 255 - G;
B := 255 - B;
Result := RGB(R,G,B);
end;
But somehow this seems off to me, for example if the original color was a kind of green then it will result in a brownish color for the negative color, it just doesn't seem right to me, can anyone shed any light on this?
Second question: At first I was using TPaintBox but for some reasom it wouldn't show the TPen.Style (anyone know why that is btw?) that was applied so now I just directly draw to the Self.Canvas. But for some reason if I draw for example 10 figures and something pops over it, it will only show the last drawn figure when the form is on top again. Can anyone explain to me how I can make it remember all 10 drawings?
I suppose I could use CopyRect to copy it to a bitmap and then re-apply it using the Form's OnShow event but I feel I shouldn't have to do that (if it even works, haven't tried yet).
Thanks for reading my questions, bigger thanks if you bother with answering them ;-)
BobbaFet
Code:
if not Programming = 'Severe Migraine' then
ShowMessage('Eureka!');