www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@xregGui/@javaToolbar/pSetImagePosition.m

    function pSetImagePosition(obj, posRect)
%PSETIMAGEPOSITION Reposition the image object
%
%  PSETIMAGEPOSITION(OBJ) is a private method that repositions the image
%  object and the mouse-tracking region.
%  PSETIMAGEPOSITION(OBJ, IMDATA) also simulataneously sets new image data
%  into the image object.

%  Copyright 2000-2004 The MathWorks, Inc. and Ford Global Technologies, Inc.


% Position the edge frame
if posRect(4)>(obj.ButtonHeight+6)
    edgepos = posRect;
    edgepos(2) = posRect(2) + floor((posRect(4)-obj.ButtonHeight-6)*0.5);
    edgepos(4) = obj.ButtonHeight+6;
else
    edgepos = posRect;
end
obj.hJavaImage.Position = edgepos;