skew an image - Forum

Forum Navigation
You need to log in to create posts and topics.

skew an image

I can:

SizeObject
RotateObject

But how do I skew an image object?

.

Short answer: there isn’t a built-in SkewObject action.
You can skew any object (including an Image) by applying a CSS transform to it.

Option 1 — Inline style with NeoScript

. skew 20° on X
SetObjectStyle "Image1" "transform: skewX(20deg); transform-origin: center;"


.skew 15° on Y
SetObjectStyle "Image1" "transform: skewY(15deg); transform-origin: center;"

 

Option 2 — Add a CSS class (cleaner if you’ll reuse it)

  1. Put this in Project → Properties → Custom CSS:

.skewX20 { transform: skewX(20deg); transform-origin: center; }
.skewY15 { transform: skewY(15deg); transform-origin: center; }

 

  1. Then toggle it in code:

AddObjectClass "Image1" "skewX20" ; RemoveObjectClass "Image1" "skewX20"

Notes:

  • transform-origin lets you skew around the center (or any anchor you want).

  • You can combine with other transforms, e.g. transform: rotate(10deg) skewX(20deg);

  • Layout (the object’s left/top/width/height) stays the same; only the rendering is skewed. If you need to reposition after skewing, adjust with MoveObject/SizeObject.

fkapnist has reacted to this post.
fkapnist

SetObjectStyle requires 3 parameters

Actually, it is not skew but horizontal perspective degrees that I want to change in an image.

 

Uploaded files:
  • You need to login to have access to uploads.

@fkapnist you may want to visit this thread:

Scrolling text in 3D - Forum - VisualNEO. Cross-platform App Development Tool for Windows

Regards.