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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:37:11+00:00 2026-05-23T08:37:11+00:00

Since using the DrawArc function in GDI+ isn’t very accurate when drawing a small

  • 0

Since using the DrawArc function in GDI+ isn’t very accurate when drawing a small rounded rectangle, I am using RoundRect instead.

Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  Dim hDC As IntPtr = e.Graphics.GetHdc
  Dim rc As New Rectangle(10, 10, 64, 24)
  Dim hPen As IntPtr = Win32.CreatePen(Win32.PenStyle.PS_SOLID, 0, _
                                       ColorTranslator.ToWin32(Color.Green))
  Dim hOldPen As IntPtr = Win32.SelectObject(hDC, hPen)
  Call Win32.RoundRect(hDC, rc.Left, rc.Top, rc.Right, rc.Bottom, 10, 10)
  Win32.SelectObject(hDC, hOldPen)
  Win32.DeleteObject(hPen)
  e.Graphics.ReleaseHdc(hDC)
  MyBase.OnPaint(e)    
End Sub

This will draw a nice rounded rectangle, but it will also fill it with a white brush, erasing what I don’t want to have erased.

How can I draw this without erasing the inside of the rectangle?

  • 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-23T08:37:11+00:00Added an answer on May 23, 2026 at 8:37 am

    You just need to select a stock, hollow brush before you draw the rectangle. Call GetStockObject with HOLLOW_BRUSH and then select that into the device context in the same way as you selected the pen.

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

Sidebar

Related Questions

How can I do accurate decimal number arithmetic since using floats is not reliable?
I haven't touched Java since using JBuilder in the late 90's while at University,
I know it can't be done since using var can only be done for
Since I am using get I expect to see the submitted values appended to
Since I'm using Postgresql and can't use LINQ to SQL, I wrote my own
Ever since I started using .NET, I've just been creating Helper classes or Partial
I've been using Winforms since .NET 1.1 and I want to start learning WPF.
I've been using SVN since a long time and now we're trying on Git.
I've been developing stuff using ActionScript since AS2,and when AS3 was released i had
We are team of few Delphi developers who have been using VSS since years

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.