Question : Drawing continuously without stretching

Hello,

Windows draw a toolbar with a small image source without stretching...
In a Delphi Toolbar i know that is possible do the same, in CustomDraw using copyrect but...

Look the attached file (header.bmp), was removed from a Windows MSStyle and is what Windows use to draw the toolbar... (toolbar.png) is a sample from what i'm talking about... the background of the toolbar is the header.bmp painted continuously

How can i do the same with my toolbar? since "CopyRect" will draw only the image but not continuously...

Some idea?

Regards,
Carlos
Attachments:
 
Windows toolbar
Windows toolbar
 
 
source background for the toolbar
source background for the toolbar
 

Answer : Drawing continuously without stretching

since the image is the same on every column, a strecthdraw or multiple draw one after the other would produce the same result

Canvas.StretchDraw(Rect,HeaderBmp);

or

While Rect.Left<Rect.Right do
  begin
   Canvas.Draw(Rect.Left,Rect.Top,HeaderBmp);
   Rect.Left:=Rect.Left+HeaderBmp.Width;
  end;

but really I see only problems with not using stretchDraw for this
Random Solutions  
 
programming4us programming4us