Forum Discussion

sathish_subrama's avatar
sathish_subrama
Occasional Contributor
5 years ago

unable to identify the draw image inthe test application

unable to identify the draw image inthe test application

 

Its drawan application contains four layered diagram.

 

  • BenoitB's avatar
    BenoitB
    5 years ago

    To access the pixels array of an object, just do that (pseudo code):

      ...

    // Get the image of the object
    var image = myObject.Picture(Region bounds));
    
    // Accessing individual pixel by
    if (image.Pixels(i, j) == MycolorToCheck) 
     ...

    // MycolorToCheck could be a predefined Windodws color (clBlack, clAqua, ..) or in RGB format.

     

    For more information, type Pixels and Working with color in your TestComplete help (magic F1 key).

     

     

     

  • Wamboo's avatar
    Wamboo
    Community Hero

    hi sathish_subrama 

     

    What exactly Do You want to do with this picture?

     

    1. Compare?

    2. Read as obj and use in function?

    3. Anything else?

    • sonya_m's avatar
      sonya_m
      SmartBear Alumni (Retired)

      Thank you Benoit and Wamboo! We appreciate your input.

       

      sathish_subrama did you find a way to identify the image using suggestions from this thread or any other way? Please update and let us know if you still need advice on that:smileyhappy:

  • BenoitB's avatar
    BenoitB
    Community Hero
    if its directly drawn on windows canvas, its not an object thus not visible by object inspection
    Depends of the test goal but perhaps work with pixel colors ?
    • sathish_subrama's avatar
      sathish_subrama
      Occasional Contributor

      its directly drawn on windows canvas -which i am unable to identify the object using test complete.

       

      Could you please explain how to do with pixel color identification?

       

      • BenoitB's avatar
        BenoitB
        Community Hero

        To access the pixels array of an object, just do that (pseudo code):

          ...

        // Get the image of the object
        var image = myObject.Picture(Region bounds));
        
        // Accessing individual pixel by
        if (image.Pixels(i, j) == MycolorToCheck) 
         ...

        // MycolorToCheck could be a predefined Windodws color (clBlack, clAqua, ..) or in RGB format.

         

        For more information, type Pixels and Working with color in your TestComplete help (magic F1 key).