 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ma Xiaoguang Guest
|
Posted: Tue Oct 04, 2005 9:32 am Post subject: How to skew an image? |
|
|
Dear ladies and gentlemen,
I want to skew rectangular image in any shaped quadrangle. I have
thought about this function for many days. In my solution, It was a linear
skew. For example, to get all the points on the left side and right side of
the quadrangle, and each pairs of the two points which was from the left
side and right side would be two ending points for a line. And then, we can
read one line from the source bitmap, and stretch draw the source line to
the dest line which was getting by ourselves. The problem of my approach is
that it cannot processes all the points in a non-regular quadrangle, some of
the points are ignored.
I have searched the information which is about skew image by Google, but
unfortunately, there are too many results from Google. I have checked out a
lot of the results, but none of them has satisfied what I want. Most of them
skew image in parallelogram, including the demos from Graphics32.
Could you please give me some suggestions and information for this
question?
Thank you very much!
Best regards.
Xiaoguang
|
|
| Back to top |
|
 |
Nils Haeck Guest
|
Posted: Tue Oct 04, 2005 11:49 am Post subject: Re: How to skew an image? |
|
|
Have a look at the transformation types in Graphics32. The
TProjectiveTransformation does what you want; bilinear mapping. The name
Projective transform is not correct if you ask me, not that it bothers me
too much:).
| Quote: | lot of the results, but none of them has satisfied what I want. Most of
them
skew image in parallelogram, including the demos from Graphics32.
|
Nope, TProjectiveTransform does not map to a parallelogram, but really to a
4-point quadrangle. You can try out the demo of Dtpdocuments, and add a
"Projective Text" shape to verify:
http://www.simdesign.nl/Download/dtpdemo.zip
Nils
"Ma Xiaoguang" <maxiaoguang10000 (AT) sina (DOT) com> schreef in bericht
news:43424b37 (AT) newsgroups (DOT) borland.com...
| Quote: | Dear ladies and gentlemen,
I want to skew rectangular image in any shaped quadrangle. I have
thought about this function for many days. In my solution, It was a linear
skew. For example, to get all the points on the left side and right side
of
the quadrangle, and each pairs of the two points which was from the left
side and right side would be two ending points for a line. And then, we
can
read one line from the source bitmap, and stretch draw the source line to
the dest line which was getting by ourselves. The problem of my approach
is
that it cannot processes all the points in a non-regular quadrangle, some
of
the points are ignored.
I have searched the information which is about skew image by Google,
but
unfortunately, there are too many results from Google. I have checked out
a
lot of the results, but none of them has satisfied what I want. Most of
them
skew image in parallelogram, including the demos from Graphics32.
Could you please give me some suggestions and information for this
question?
Thank you very much!
Best regards.
Xiaoguang
|
|
|
| Back to top |
|
 |
John Guest
|
Posted: Tue Oct 04, 2005 12:29 pm Post subject: Re: How to skew an image? |
|
|
I think that what you need is Billinear warping.
projective transform of G32 is a little bit different because it give a
projective effect, billiear warping is more neutral.
Pixelook supports this but unfortunately this library seems to be dead...
Antigrain also seems to support it.
GDI+ supports it with path also.
|
|
| Back to top |
|
 |
Ma Xiaoguang Guest
|
Posted: Wed Oct 05, 2005 1:14 am Post subject: Re: How to skew an image? |
|
|
Hello Nils,
Thanks for you help. I will check out the dtpdemo carefully.
Best regards.
Xiaoguang
"Nils Haeck" <bla (AT) bla (DOT) com> 写入消息新闻:43426a67$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Have a look at the transformation types in Graphics32. The
TProjectiveTransformation does what you want; bilinear mapping. The name
Projective transform is not correct if you ask me, not that it bothers me
too much:).
lot of the results, but none of them has satisfied what I want. Most of
them
skew image in parallelogram, including the demos from Graphics32.
Nope, TProjectiveTransform does not map to a parallelogram, but really to
a
4-point quadrangle. You can try out the demo of Dtpdocuments, and add a
"Projective Text" shape to verify:
http://www.simdesign.nl/Download/dtpdemo.zip
Nils
"Ma Xiaoguang" <maxiaoguang10000 (AT) sina (DOT) com> schreef in bericht
news:43424b37 (AT) newsgroups (DOT) borland.com...
Dear ladies and gentlemen,
I want to skew rectangular image in any shaped quadrangle. I have
thought about this function for many days. In my solution, It was a
linear
skew. For example, to get all the points on the left side and right side
of
the quadrangle, and each pairs of the two points which was from the left
side and right side would be two ending points for a line. And then, we
can
read one line from the source bitmap, and stretch draw the source line
to
the dest line which was getting by ourselves. The problem of my approach
is
that it cannot processes all the points in a non-regular quadrangle,
some
of
the points are ignored.
I have searched the information which is about skew image by Google,
but
unfortunately, there are too many results from Google. I have checked
out
a
lot of the results, but none of them has satisfied what I want. Most of
them
skew image in parallelogram, including the demos from Graphics32.
Could you please give me some suggestions and information for this
question?
Thank you very much!
Best regards.
Xiaoguang
|
|
|
| Back to top |
|
 |
Ma Xiaoguang Guest
|
Posted: Wed Oct 05, 2005 1:17 am Post subject: Re: How to skew an image? |
|
|
Hello John,
Thanks for your help.
Best regards.
Xiaoguang
"John" <prout (AT) nospam (DOT) com> 写入消息新闻:43427533 (AT) newsgroups (DOT) borland.com...
| Quote: | I think that what you need is Billinear warping.
projective transform of G32 is a little bit different because it give a
projective effect, billiear warping is more neutral.
Pixelook supports this but unfortunately this library seems to be dead...
Antigrain also seems to support it.
GDI+ supports it with path also.
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|