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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:48:55+00:00 2026-06-15T08:48:55+00:00

Direct2D has D2D1_RECT_F { FLOAT left; FLOAT top; FLOAT right; FLOAT bottom; } It’s

  • 0

Direct2D has D2D1_RECT_F

{
    FLOAT left;
    FLOAT top;
    FLOAT right;
    FLOAT bottom;
}

It’s similar to GDI RECT structure except it uses float values.

typedef struct tagRECT
{
    LONG    left;
    LONG    top;
    LONG    right;
    LONG    bottom;
} RECT;

GDI provides all those RECT manipulation functions like

BOOL IntersectRect(
   _Out_  LPRECT lprcDst,
   _In_   const RECT *lprcSrc1,
   _In_   const RECT *lprcSrc2
);

BOOL SubtractRect(
   _Out_  LPRECT lprcDst,
   _In_   const RECT *lprcSrc1,
   _In_   const RECT *lprcSrc2
);

I can’t believe Direct2D doesn’t provide similar functions for D2D1_RECT_F.

I guess I can create rectangular geometries and combine them any way I want but that’s creating and allocating objects instead of doing simple math.
Or I guess I may just create my own versions of them.

Am I missing something? Thanks.

  • 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-15T08:48:57+00:00Added an answer on June 15, 2026 at 8:48 am

    For IntersectRect, Direct2D has ID2D1Geometry::CompareWithGeometry which will determine the relationship between two geometries, that’s will work for you. note, this function only return the relationship of the two geometries, such as overlap, contains, it will not return the intersection rectangle as what IntersectRect did.

    For SubtractRect, Direct2D has no such function, you need to write it yourself.

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

Sidebar

Related Questions

So I have this webpage built that has a photo gallery on the left
Man so much has changed since I learned DirectX 7. Everywhere I look (except
I'm drawing a custom chart using Direct2D. The chart has x and y-axis labels
A programmer I know has a website that is fully Standards Compliant. It uses
I'm using Direct2D in C# to render a small gui framework for my research
I am extremely new to Direct2D after just looking at the MSDN start guide
Has anyone out there created a version of GDI32.dll that takes advantage of hardware
Shopify has a CARTS api but it is read-only. I am trying to find
This question has a great answer for detecting cycles in a directed graph. Unfortunately,
The IEEE has a long list of standards for almost every step within the

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.