Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8191679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:58:17+00:00 2026-06-07T03:58:17+00:00

I have a procedure: procedure DrawSolidHexImage(Target: TCanvas; { Canvas to draw hex on }

  • 0

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?

{Solid Hexagon drawing function}
procedure THexMap.DrawSolidHeximage(Target:TCanvas;
                          Fillstyle : TBrushStyle;
                          Fillcolor : TColor;
                          Fillimage : TBitmap;
                          Linestyle : TPenStyle;
                          LineColor : Tcolor;
                          x,y,radius: integer;
                          button    : boolean);
 var
   p0,p1,p2,p3,p4,p5,p6:TPoint;
 Begin
   p0 := Point(x,y);

   {compute each point of hex based on center coordinate (p0) }
   p1.x := p0.x - round(Radius /2);
   p1.y := p0.y - Rise;
   p2.x := p0.x + round(Radius /2);
   p2.y := p1.y;
   p3.x := p0.x + Radius;
   p3.y := p0.y;
   p4.x := p2.x;
   p4.y := p0.y + rise;
   p5.x := p1.x;
   p5.y := p4.y;
   p6.x := p0.x - Radius;
   p6.y := p0.y;

   {set color / Style of lines}
   target.pen.color := linecolor;
   target.pen.style := linestyle;

   {Set color and style of hex }
   target.brush.color := FillColor;
   target.brush.style := FillStyle;
   target.Brush.Bitmap := Fillimage;

   {draw the hex}
   target.polygon([p1,p2,p3,p4,p5,p6]);

   {If Desired, draw the borders for the hex}
   if button = true then
   begin
     with target do
     begin
       pen.mode:=pmcopy;
       pen.color:=clWhite;
       moveto(p5.x+1,p5.y-1);
       lineto(p6.x+1,p6.y);
       lineto(p1.x+1,p1.y+1);
       lineto(p2.x-1,p2.y+1);
       pen.color:=clBlack;
       lineto(p3.x-1,p3.y);
       lineto(p4.x-1,p4.y-1);
       lineto(p5.x+1,p5.y-1);
     end;
   end;
 end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:58:18+00:00Added an answer on June 7, 2026 at 3:58 am

    Yep, see my second comment: Target.Brush.Bitmap is set. Removal of that line will prevent the tiling effect, but will also completely prevent any image from being drawn. To compensate that, use something like:

    Target.Draw(x, y, FillImage);
    

    You may have to fiddle with the coordinates though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So if a language provides higher order procedure then I can have procedure that
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
I have a procedure which uses 2 sql databases - this is required in
I have stored procedure in my database and i need to look up a
I have a procedure in T-SQL from here which works perfectly when I execute
i have a procedure in which i am inserting record in employee table.nad getting
I have a procedure that is run for a lot of items, skipping over
I have this procedure i my package: PROCEDURE pr_export_blob( p_name IN VARCHAR2, p_blob IN
I have a procedure with Sender: TObject paramater procedure TForm1.FormCreate(Sender: TObject); How can I
I have this procedure that executes another procedure passed by a parameter and its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.