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

  • Home
  • SEARCH
  • 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 5850147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:06:01+00:00 2026-05-22T13:06:01+00:00

I want to draw a shape with square, diamond, and cross shape. The square

  • 0

I want to draw a shape with square, diamond, and cross shape. The square line is solid, and fine. However, the line of both diamond and cross look like dashed or dotted. I want all shapes have solid line.

Any ideas?

Below is the code, and shapes:

http://www.sendspace.com/file/n3wljs

private void CreateVariousShapes()
{
    Bitmap bitmap = new Bitmap(17, 17);
    Graphics graphics = Graphics.FromImage(bitmap);
    Pen pen = new Pen(Color.Black);
    pen.Width = 1;
    pen.DashStyle = DashStyle.Solid;
    Brush brush = new SolidBrush(Color.White);

    //graphics.FillRectangle(brush, 0, 0, 16, 16);

    //graphics.DrawRectangle(pen, 0, 0, 16, 16);

    FillDiamond(brush, graphics);
    DrawDiamond(pen, graphics);

    DrawCross(pen, graphics);

    //bitmap.Save(MapPath("SquareDiamondCross.png"),ImageFormat.Png);
    //bitmap.Save(MapPath("SquareCross.png"), ImageFormat.Png);
    //bitmap.Save(MapPath("SquareDiamond.png"), ImageFormat.Png);
    bitmap.Save(MapPath("DiamondCross.png"), ImageFormat.Png);
}

private void FillDiamond(Brush brush, Graphics graphics)
{
    Point[] points = new Point[]
                        { new Point(0,8), 
                        new Point(8,16), 
                        new Point(16,8), 
                        new Point(8,0), 

                        };

    graphics.FillPolygon(brush, points);
}

private void DrawDiamond(Pen pen, Graphics graphics)
{
    Point[] points = new Point[]
                        { new Point(0,8), 
                        new Point(8,16), 
                        new Point(16,8), 
                        new Point(8,0), 
                        };
    graphics.DrawPolygon(pen, points);
}

private void DrawCross(Pen pen, Graphics graphics)
{
    graphics.DrawLine(pen, 4, 2, 2, 4);

    graphics.DrawLine(pen, 2, 12, 4, 14);

    graphics.DrawLine(pen, 12, 14, 14, 12);

    graphics.DrawLine(pen, 12, 2, 14, 4);

    graphics.DrawLine(pen, 2, 4, 6, 8);
    graphics.DrawLine(pen, 2, 12, 6, 8);

    graphics.DrawLine(pen, 4, 14, 8, 10);
    graphics.DrawLine(pen, 12, 14, 8, 10);

    graphics.DrawLine(pen, 14, 12, 10, 8);
    graphics.DrawLine(pen, 14, 4, 10, 8);

    graphics.DrawLine(pen, 12, 2, 8, 6);
    graphics.DrawLine(pen, 4, 2, 8, 6);
}
  • 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-05-22T13:06:02+00:00Added an answer on May 22, 2026 at 1:06 pm

    Set the following graphics properties:

    graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
    graphics.SmoothingMode = SmoothingMode.HighQuality;
    

    Hopefully you will get what you want.

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

Sidebar

Related Questions

I want to draw a HBITMAP onto HDC, I used StretchDIBits. It works fine.
Let's say I want to draw a simple quad like this: glBegin(GL_QUADS); glVertex2f(-1.0,-1.0); glVertex2f(1.0,-1.0);
How can i draw a box in css? I want a box like the
I want to draw a shape(many circles particularly) into a Specific Bitmap. I have
I want to draw DirectX content so that it appears to be floating over
I want to draw a shadow around a thumbnail in my software. It seems
To get some smooth graphics, I want to draw oversampled by factor 2 and
I have a SWF Video player on my webpage. I want to draw a
I want to let the user draw on an image in a browser. In
Using Python I want to be able to draw text at different angles using

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.