Ask a Question

Problem with PictureObj.Stretch(Width, Height)

mafuko
Occasional Contributor

Problem with PictureObj.Stretch(Width, Height)

HI,

I want use this picture methods "stretch"  PictureObj.Stretch(Width, Height)  in TestComplete5 with VBscript like this:



    Set ObrazokObj = Sys.Desktop.Picture

    ObrazokObj.Stretch(800,800)

    ObrazokObj.SaveToFile("D:\plocha.png")



But I cant run the script, because I got this error:

    Syntax error



    At "

    ObrazokObj.Stretch(800,800)

    O"

    error 100:Syntax error while processing ",".

I don't understand why, can you pls write me how Can I change this methods of picture ? or other oportunity how to reduce size of image ? (I dont want use PictureObj.size)

3 REPLIES 3
tristaanogre
Esteemed Contributor

Change your code to the following:





    Set ObrazokObj = Sys.Desktop.Picture

    Call ObrazokObj.Stretch(800, 800)

    Call ObrazokObj.SaveToFile("D:\plocha.png")





I'm no VB expert but IIRC, if you're calling a method on an object, you need to preface the line with "Call".  The above works fine.

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available


Hi Matus,





As Robert said, you need to call the Stretch method by using the Call statement. However, you can also call the method in the following way:











I recommend that you read the MSDN 'Call Statement' article for more information.
--
Dmitry Nikolaev

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
mafuko
Occasional Contributor

Thank you very much,

I don't see this mistake and 2 my frineds too 😄 other point of view everytime help.
cancel
Showing results for 
Search instead for 
Did you mean: