Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27196

Can I return a bitmap or is it a copy?

$
0
0
I have a class where a member is a Bitmap. When I create the object, the constructor requires me to load the Bitmap.

I created a ReadOnly Property that returns this Bitmap, like this...

Code:

        Public ReadOnly Property Sprite As Bitmap
        Get
            Return m_Sprite
        End Get
        End Property

My question is this. Am I making an unnecessary copy of the Bitmap everytime I call this Property? I will have lot's of these objects, so I want to make sure, I optimize this correctly. Would there be a better way to do this?

Viewing all articles
Browse latest Browse all 27196

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>