Without knowing what mcMain
and stage
are, no, not easily. I assume that stage
refers to the main drawing area; assuming that you are drawing within a UIView
subclass, you can find the dimensions of the view by calling bounds
upon the view:
CGRect bounds = self.bounds;
This will return a CGRect
, which in itself is comprised of a CGPoint
, called origin
, and a CGSize
called size
; these are C-structs:
struct CGPoint {
CGFloat x;
CGFloat y;
};
struct CGSize {
CGFloat width;
CGFloat height;
};
To find the height of the UIView
, you can do so quite simply:
CGFloat height = self.bounds.size.height;
Assuming that you are trying to find out the height of the view from within the view class itself.
I'm guessing that mcMain
refers to some kind of image or object, so implementation of that is dependent on what it is. However, most co-ordinates rely on CGRect
, CGPoint
and CGSize
in some way or another.