Stop image from tiling
- by Glen Morse
I have a procedure:
procedure DrawSolidHexImage(Target: TCanvas; { Canvas to draw hex on }
Fillstyle : TBrushStyle; { How to fill the hex }
Fillcolor : TColor; { Color to fill it }
fillimage : Tbitmap; { Image to show}
Linestyle : TPenStyle; { What kind of lines }
LineColor : Tcolor; { What color for lines }
x,y,radius: integer; { Position and size of Hex }
button : boolean); { Make hexes look like buttons? }
When I use this, the image is tiled to fill the area. Is there something I can add or must remove to make it not tile? Thus not repeating the image. Maybe make it center?
The Code in which I use DrawSolidHexImage looks like:
procedure THexMap.ImageAHex(ImageWanted : TBitmap;
HexPatternWanted: TBrushStyle;
MapLocation:TPoint);
var
p0:TPoint;
begin
if FHexMapOn and FDrawSolidMap and (not UseSavedMap) then
begin
with TempMap.canvas do
p0 := ConvertCoords(Point(MapLocation.x,MapLocation.y),ptROWCOL);
DrawSolidHexImage(TempMap.Canvas,HexPatternWanted,clGray,
Imagewanted,psSolid,LineColor,p0.x,p0.y,hexradius,hex3d);
Refresh;
end;
end;