Forum Discussion

DevaV's avatar
DevaV
Contributor
13 years ago

Problem in picture

Hi,



When we use picture funtion for object with wndclass as Static, It gives a black color image but not the required image. Below is method that we used for taking the picture.



x = staticWndclassObj.Left;

y = staticWndclassObj.Top

width = staticWndclassObj.width

height = staticWndclassObj.height

staticWndclassObj.Picture(x,y,width,height);



The same strategy when we tried with the images of WndClass -"listbox", we are able to get the image.



Is there any between in using picture method if Wndclass property differs. Also kindly let us know other method to take the picture of a particular portion.



Actual and Expected image has been attached for reference.



Thanks,

Deva.

2 Replies

  • Julia_K's avatar
    Julia_K
    SmartBear Alumni (Retired)

    Hello,


    Please note that the Top and Left properties you use in your sample script return the object's position relative to the object's parent window, while the ClientX and ClientY parameters of the Picture method take object relative coordinates.

    The Picture method in your sample script may return a black box, because the rectangle area specified by the method's parameters is out of the object's bounds.

    Please check whether the same issue persists if you modify your sample script in one of the following ways:

    1)



    width = staticWndclassObj.width;

    height = staticWndclassObj.height;

    staticWndclassObj.Picture(0, 0, width,height);



    2)



    staticWndclassObj.Picture();



    If the Picture method is called without parameters, it returns an image of the whole on-screen object.


    Please let us know whether any of these ways helps.

    Thanks in advance.

  • Hi,



    Thanks for reply and it works fine as you said.



    Thanks,

    Deva.