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 3760550
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:29:18+00:00 2026-05-19T10:29:18+00:00

i want to fill the bottom-left half of a a rectangle (i.e. a triangle):

  • 0

i want to fill the bottom-left half of a a rectangle (i.e. a triangle):

alt text

with a LinearGradient, going from color to transparent:
alt text

Filling half a rectangle:

alt text

i know the point (x,y), and the size of the rectangle.

If i try using a LinearGradientBrush, to perform my linear gradient:

brush = new LinearGradientBrush(
      MakePoint(0, y), //bottom left corner
      MakePoint(x, 0), //upper right corner
      MakeColor(255, c), //fully opaque color
      MakeColor(0, c)); //fully transparent color
graphics.FillRectangle(brush, MakeRect(0, 0, w, h));

The linear gradient brush fills the entire rectangle, which would be fine if it continued to fill the rest of the rectangle with the final (transparent) color; but instead it wraps around:

alt text

i have my LinearGradientBrush how i like, i just want to FillTriangle or FillPolygon, rather than FillRectangle. Except there is no FillTriangle or FillPolygon, only FillRectangle, and FillEllipse.

See also

link text

  • 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-19T10:29:19+00:00Added an answer on May 19, 2026 at 10:29 am

    There is a FillPolygon in the Graphics library. I think you should be able to do it like this:

    brush = new LinearGradientBrush(
          MakePoint(x, y), 
          MakePoint(0, h), 
          MakeColor(255, c), //fully opaque color
          MakeColor(0, c)); //fully transparent color
    
    graphics.FillPolygon(brush, new PointF[] {
            new PointF(0, 0),
            new PointF(0, h),
            new PointF(w, h)
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create such layout: +-----------container-----------+ | +-----fixed-height-div-------+| | +-------fixed-height-div-----+| | +-fill-height-scrollable-div-+| | +-fixed-height-bottom-div-+| +---------end-container-------+ The problem
I want to fill jqGrid from a stored procedure, there was 1 good example
I simply want to fill-up cells in my spreadsheet from a VBA function. By
I Had Drop down list and I want to fill it with data from
I want to fill an array in javascript that takes all the values out
I want to fill a ListView without an array of all the same things.
I want to fill all cells with the same control. What I have now
I have an ImageButton that I want to fill its parent RelativeLayout container for
I have an Android application with a Spinner and want to fill it dynamically
here's my question, i want to fill the content div with white. BUT when

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.