Page 1 of 1
TGradient Problem with Windows7

Posted:
March 2nd, 2010, 10:34 am
by soul
Hello,
I've got a strange problem with the TGradient component under Windows7.
The canvas is not completely filled when I use the fill option gsLinearH - all others works fine!
There is always a small area (depends on the size of the canvas) at the bottom of the canvas which is not filled or filled with random "noise".
Anyone else got this problem? ...maybe solved?
thx!
Re: TGradient Problem with Windows7

Posted:
March 2nd, 2010, 4:16 pm
by Kambiz
I couldn't regenerate the problem.
I suggest to place the gradient control on a panel and set the panel's ParentBackground property to false.
Re: TGradient Problem with Windows7

Posted:
March 2nd, 2010, 4:55 pm
by soul
Well, it's placed on a panel and ParentBackground is false.
Same Problem with Delphi 7 and Delphi 2007.
>>take a look at the screenshot...
hmmm...

Re: TGradient Problem with Windows7

Posted:
March 2nd, 2010, 6:47 pm
by Kambiz
Please send me your source code, because all is fine with me.
Re: TGradient Problem with Windows7

Posted:
March 3rd, 2010, 12:21 pm
by soul
Hi Kambiz,
I found the problem and was able to fix it or better - create a workaround for it.
Here is the code snippet:
- Code: Select all
procedure LinearHorizontal(const Colors: TGradientColors; Pattern: TBitmap);
var
X,Y: Integer;
Row: PRGBQuadArray;
begin
Pattern.Width := 256;
Pattern.Height := 10;
for Y :=0 to 9 do
begin
Row := PRGBQuadArray(Pattern.ScanLine[Y]);
for X := 0 to 255 do
begin
Row[X] := Colors[X];
end;
end;
end;
thx for your support!
Re: TGradient Problem with Windows7

Posted:
March 3rd, 2010, 1:54 pm
by Kambiz
According to the fix, I think the display driver of your computer needs to be updated.
Re: TGradient Problem with Windows7

Posted:
March 3rd, 2010, 3:10 pm
by soul
It really seems to be a problem with the display driver!
I cannot reproduce it on other Win7 machines...
thx
Re: TGradient Problem with Windows7

Posted:
April 23rd, 2010, 5:06 pm
by soul
PS: The problem is reproducible on all new HP Notebooks with preinstalled Win7.
Seems to be a problem with the default driver.
Regards,
Soul
Re: TGradient Problem with Windows7

Posted:
April 25th, 2010, 1:20 pm
by ejla
Have noticed similar problems with eg. bitmap images and some other things too, eg. TPanels and TLabels... I think these problems have very close relation to XPManifest component (if used).
As Kambiz pointed out, such as TPanels Parent Background must be set to false at RUNTIME, and TLabels Transparency even at RUNTIME... Desingtime settings seems to be ignored!?
With Bitmap problems I have found solutions with PixelFormat setting, eg. Image.Picture.Bitmap.PixelFormat := pf8bit;
Erkki