A method for controlling a haptic effect of an input unit by a portable terminal, the method comprising: displaying an image with at least one object on a touch screen of the portable terminal; identifying a touch input by the input unit with respect to the object displayed on the touch screen; determining a preset mode for the haptic effect to be provided by the input unit based on the touch input by the input unit; generating a first control signal corresponding to a first haptic pattern based on the determined preset mode; and transmitting, to the input unit, the generated first control signal, wherein the method further comprises: if the preset mode is a mode for drawing a contour on the displayed object, displaying the contour in a proceeding direction of the input unit along a virtual contour identified around the object based on an analysis of the brightness differences between adjacent pixels of the image displayed on the touch screen; when a size of a gap between the virtual contour and the contour displayed in the proceeding direction of the input unit is within a predetermined range, generating a second control signal corresponding to a second haptic pattern and transmitting, to the input unit, the generated second control signal, and when the size of the gap exceeds the predetermined range, generating the second control signal corresponding to a third haptic pattern, deleting a part of the contour displayed beyond the predetermined range, generating a third control signal corresponding to a predetermined haptic pattern for contour deletion; and transmitting, to the input unit, the generated second and third control signals. displaying an image with at least one object on a touch screen of the portable terminal; identifying a touch input by the input unit with respect to the object displayed on the touch screen; determining a preset mode for the haptic effect to be provided by the input unit based on the touch input by the input unit; generating a first control signal corresponding to a first haptic pattern based on the determined preset mode; and transmitting, to the input unit, the generated first control signal, wherein the method further comprises: if the preset mode is a mode for drawing a contour on the displayed object, displaying the contour in a proceeding direction of the input unit along a virtual contour identified around the object based on an analysis of the brightness differences between adjacent pixels of the image displayed on the touch screen; when a size of a gap between the virtual contour and the contour displayed in the proceeding direction of the input unit is within a predetermined range, generating a second control signal corresponding to a second haptic pattern and transmitting, to the input unit, the generated second control signal, and when the size of the gap exceeds the predetermined range, generating the second control signal corresponding to a third haptic pattern, deleting a part of the contour displayed beyond the predetermined range, generating a third control signal corresponding to a predetermined haptic pattern for contour deletion; and transmitting, to the input unit, the generated second and third control signals. if the preset mode is a mode for drawing a contour on the displayed object, displaying the contour in a proceeding direction of the input unit along a virtual contour identified around the object based on an analysis of the brightness differences between adjacent pixels of the image displayed on the touch screen; when a size of a gap between the virtual contour and the contour displayed in the proceeding direction of the input unit is within a predetermined range, generating a second control signal corresponding to a second haptic pattern and transmitting, to the input unit, the generated second control signal, and when the size of the gap exceeds the predetermined range, generating the second control signal corresponding to a third haptic pattern, deleting a part of the contour displayed beyond the predetermined range, generating a third control signal corresponding to a predetermined haptic pattern for contour deletion; and transmitting, to the input unit, the generated second and third control signals.