Stop image from tiling

Posted by Glen Morse on Stack Overflow See other posts from Stack Overflow or by Glen Morse
Published on 2012-07-04T02:04:56Z Indexed on 2012/07/04 21:16 UTC
Read the original article Hit count: 246

Filed under:

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;

© Stack Overflow or respective owner

Related posts about delphi