SYLVAIN Posted October 13, 2008 Share Posted October 13, 2008 Hello In a I would like to perform a scaling operation on an imported bitmap object. but "Hscale2D" doesn't work on it. "scale" doesn't either. Someboby knows a way to do that in a script ? I am still using version 12.5.3 of VW Thanks Quote Link to comment
maarten. Posted October 13, 2008 Share Posted October 13, 2008 Scale Works fine here. Be sure that the bitmap is selected (if not, you can use SetSelect). Quote Link to comment
SYLVAIN Posted October 13, 2008 Author Share Posted October 13, 2008 scale works, you're right, thanks i had only a selection problem. the problem is i would like to make an homothecy from a referenced point, like "Hscale2D" should do... but it doesn't seem to work. Quote Link to comment
maarten. Posted October 13, 2008 Share Posted October 13, 2008 HScale2D does work too, but you need to refresh your screen to see it. HScale2D(FSActLayer,0,0,2,2,TRUE); RedrawAll; (you can use other things then RedrawAll that asks less performance of your computer, but i can't think of one right now, sorry...) Quote Link to comment
Miguel Barrera Posted October 13, 2008 Share Posted October 13, 2008 1. You can use Redraw for newly created objects. 2. You can use ResetObject(objectHandle :HANDLE) to force a redraw 3. Create a Rect around the bitmap and then delete it. Quote Link to comment
SYLVAIN Posted October 14, 2008 Author Share Posted October 14, 2008 Thanks for advices. I finally made it. 2 conditions seems to be necessary to make it work properly : 1- the image must be in a group (it can be alone in it) 2- Redraw or resetobject this one works : PROCEDURE scale; VAR ppX,ppY:REAL; photo:HANDLE; BEGIN GetPt(ppX, ppY); photo:=PickObject(ppX, ppY); SetSelect(photo); group; HScale2D(FSActLayer,0,0,2,2,TRUE); ResetObject(photo); END; run(scale); Quote Link to comment
SYLVAIN Posted October 14, 2008 Author Share Posted October 14, 2008 It doesn't work if the bitmap is rotated. It sounds like the angle must be 0 Quote Link to comment
maarten. Posted October 14, 2008 Share Posted October 14, 2008 The problem is that the bitmap is a fixed 'rectangle', so it will always have square corners. If the bitmap has an other rotation then 0? or 90?, it will not scale. Same thing goes for the new rectangles (2008), you can't scale them either when they are rotated. BTW, i think that the lines SetSelect(photo); and group; aren't necessary. Quote Link to comment
SYLVAIN Posted October 21, 2008 Author Share Posted October 21, 2008 Thank you for those usefull explanations. Now I understand better the behavior of this type of objects. 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.