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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:40:58+00:00 2026-06-12T11:40:58+00:00

Why is Matrix a heavyweight class derived from MarshalByRefObject instead of a lightweight struct?

  • 0

Why is Matrix a heavyweight class derived from MarshalByRefObject instead of a lightweight struct?

  • 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-12T11:40:59+00:00Added an answer on June 12, 2026 at 11:40 am

    The Matrix class is actually a wrapper to an unmanaged structure which is manipulated by the GDI+ Flat API.

    That said, it’s common for the classes in the System.Drawing namespace to derive from the MarshalByRefObject class for the convenience of an IDisposable implementation as well as get automatic marshaling across the application domain boundary when used in Remoting.

    This was more than likely done because most of the GDI functions (which most of the APIs that the Windows Forms controls rely on) will use the GDI matrix for transformations; using a lightweight, fully managed code structure would require translation of that structure across the managed/unmanaged boundary every time a method was called.

    Compared to the cost of marshaling just the call and the handle, versus the call and the entire structure whenever you want to do operations on the matrix, it was probably decided that for performance reasons it was better to marshal the calls.

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

Sidebar

Related Questions

Consider having a matrix. From this matrix I select the same number of elements
I have defined a Matrix module as follows: module Matrix = struct type 'a
I am coding a matrix template class and the problem I am having is
class Matrix(db.Model): values = db.ListProperty() obj = Matrix() wx = [[1,0],[0,1]] obj.put() how to
struct Matrix(T, size_t row, size_t col){ alias row Row; alias col Col; auto opBinary(string
I use a custom Matrix class in my application, and I frequently add multiple
I have a template matrix class class defined in a header called Matrix.h. Certain
I have an 8x8 matrix in numpy (matrix class) and it keeps printing it
I created a matrix class: template <typename T> class Matrix { public: Matrix(size_t n_rows,
I made a matrix class MxN of type T and tried to instantiate and

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.