[Closed] Remove inset from bitmap displayed in rollout?
yea on mousemove pos do works fine with the DotNet picturebox.
I was using maxscript labels. I did find a straightforward solution to the labels going over top of the buttons by just moving the label positions away from the buttons… Since the buttons are always at the bottom it wasn’t a problem. But its still not perfect as the labels and bitmap do not refresh at the exact same time. So you can see the bitmap change from borders to no borders. This lag is even more noticeable with larger bitmaps.
How is DotNet for compatibility with earlier max versions? I already got my script to enlarge/shrink images using the mousewheel with DotNet. If a user is using a max version that does not support DotNet how will the script react. Will it crash? If it doesn’t crash or give errors then I don’t see a problem.
This bitmap border thing is not a big deal. I just thought I would try to see if I could make it more like the VFB(Rendered Frame Window) in max.
For older versions of 3ds Max (R8 and older), the script would crash (throw a fatal error) as any of the dotnet controls, instructions, etc. would not exist.
Yea I thought so
I’m about ready to release my modified script but I hopefully have one last question. This should be very straightforward to do but I just can’t seem to rap my head around it. :surprised
I am trying to move a bitmap around in the window using the mousemove event. I got it to work based on the center of the image but I want to be able to drag it around. Much like the pan tool in the viewports where you can keep dragging the objects in the viewport further and further away from the viewport. Right now the image just gets centered in relation to the mouse position. So there is no way to drag the image beyond the window if the image is larger then the window and you want to see the missing parts of the image.
The code i’m using right now is…
on rollout mouseMove pos do
(
if keyboard.altPressed == true then -- Move image around in window.
(
Image.pos.x = pos.x - (Image.width / 2)
Image.pos.y = pos.y - (Image.height / 2)
)
)
ok what do you guys think of this? I used a timer but it it introduces a slight lag. The larger the timer interval the less lag but then the user could beat the timer if they press alt too fast.
I needed to use a timer because my if keyboard.altPressed == false then statment would not work after I released the alt key. I had to click somewhere to reactivate the if keyboard.altPressed == false then statement.
Anyway to do this without a timer?
Thanks.
on rollout mouseMove pos do
(
if keyboard.altPressed == true then -- Move image around in window.
(
If clock.active == false then (clock.active = true)
Img_StartMove_Pos = -1000000
Img_EndMove_Pos = Image.pos
If Image_Moving == true then
(
Image.pos = [(pos.x - Img_Start_Dist_X), (pos.y - Img_Start_Dist_Y)]
)
else
(
Img_Start_Dist_X = pos.x - Image.pos.x
Img_Start_Dist_Y = pos.y - Image.pos.y
Image.pos = [(pos.x - Img_Start_Dist_X), (pos.y - Img_Start_Dist_Y)]
Image_Moving = true
)
)
if keyboard.altPressed == false then
(
clock.active = false
Img_Start_Dist_X = pos.x - Image.pos.x
Img_Start_Dist_Y = pos.y - Image.pos.y
)
)
on clock tick do
(
If Img_StartMove_Pos != Img_EndMove_Pos then
(
Img_StartMove_Pos = Img_EndMove_Pos
Image_Moving = true
)
else
(
Image_Moving = false
)
)