Jiajing Posted December 15, 2021 Share Posted December 15, 2021 Hi all, I am trying to figure out the right fuction to change bitmap's width and height. Vs.Setheight seems do not work. Thanks Quote Link to comment
MullinRJ Posted December 15, 2021 Share Posted December 15, 2021 (edited) Hello @Jiajing, Have you tried HScale2D()? Raymond Edited December 15, 2021 by MullinRJ Quote Link to comment
Jiajing Posted December 17, 2021 Author Share Posted December 17, 2021 (edited) On 12/15/2021 at 1:14 AM, MullinRJ said: Hello @Jiajing, Have you tried HScale2D()? Raymond Thanks for pointing to the right direction, @MullinRJ. Edited December 17, 2021 by Jiajing Quote Link to comment
MullinRJ Posted December 17, 2021 Share Posted December 17, 2021 Hi @Jiajing, I got an email from the Forum from your earlier post which you since modified, so you may already have the answer, but in case not, here is a more explicit use of the call. Xdesired = 123 # your desired image width Himg = vs.FSActLayer() # handle to image object (x1, y1), (x2, y2) = vs.GetBBox(Himg) xcen, ycen = vs.HCenter(Himg) scaleF = Xdesired / (x2-x1) # for uniform scaling vs.HScale2D(Himg, xcen, ycen, scaleF, scaleF, False) HTH, Raymond 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.