BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to skew an image?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Ma Xiaoguang
Guest





PostPosted: Tue Oct 04, 2005 9:32 am    Post subject: How to skew an image? Reply with 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
Nils Haeck
Guest





PostPosted: Tue Oct 04, 2005 11:49 am    Post subject: Re: How to skew an image? Reply with 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:).

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





PostPosted: Tue Oct 04, 2005 12:29 pm    Post subject: Re: How to skew an image? Reply with 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
Ma Xiaoguang
Guest





PostPosted: Wed Oct 05, 2005 1:14 am    Post subject: Re: How to skew an image? Reply with quote

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





PostPosted: Wed Oct 05, 2005 1:17 am    Post subject: Re: How to skew an image? Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.