Solved

round rectangle drawing algorithm needed!!!

Posted on 2001-06-26
8
1,159 Views
Last Modified: 2013-11-20
I've written a roundrect algorithm which takes 6 arguments: Device Context, 4 CPoints, and angle (in degree) but I couldn't get it right, there must be cracks somewhere... so... i'm wondering is there any precoded algorithm to draw round rect (rotatable) or capsule??

"Pleeeaaaseee heeelpppp" (leeloo dallas)
0
Comment
Question by:techpage
8 Comments
 
LVL 1

Expert Comment

by:jacobkristensen
Comment Utility
Using the Platform SDK method "SetWorldTransform" you can accomplish what you want!

From MSDN lib:

SetWorldTransform
The SetWorldTransform function sets a two-dimensional linear transformation between world space and page space for the specified device context. This transformation can be used to scale, rotate, shear, or translate graphics output.

BOOL SetWorldTransform(
  HDC hdc,               // handle to device context
  CONST XFORM *lpXform   // transformation data
);
0
 
LVL 3

Author Comment

by:techpage
Comment Utility
waitt... from function's name, if i'm not mistaken... you use SetWorldTransform to transform the whole coordinate of the Device Context, arent you? so what if I want to transfrom only certain primitives and not all ??
0
 
LVL 3

Author Comment

by:techpage
Comment Utility
waitt... from function's name, if i'm not mistaken... you use SetWorldTransform to transform the whole coordinate of the Device Context, arent you? so what if I want to transfrom only certain primitives and not all ??
0
 
LVL 1

Accepted Solution

by:
jacobkristensen earned 30 total points
Comment Utility
1) You rotate the DC.
2) Draw your rotated content.
3) Rotate back.
4) Draw your non-rotated content.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 3

Author Comment

by:techpage
Comment Utility
does it sacrifice much processing time??
0
 
LVL 1

Expert Comment

by:jacobkristensen
Comment Utility
Well, of course it does take some processing time, but compared to having to write all the trivial drawing methods yourself (you can use all the standard medthods), it's probably worth it.

Also, if you are looking for optimization, maybe you can group the objects together (assuming several of them needs to be drawn in the same angle), to minimize rotation.

Does your app (graphics) need to be high performance?
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Hi techpage,
Experts-Exchange is performing an automated process to delete old questions.  There have been no responses to this question, so it will be DELETED within 3 days.

Your points will be refunded.

If you still need the answer to this question, you should ask it again, as a new question.  Your new question will appear at the top of the list, where many Experts will see it and respond.  Here are some general tips on getting Experts to work on your questions:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1) Offer a high point level.  Experts often concentrate on higher-valued questions.
2) Choose the best Topic Area -- target the experts who have the specific skills that you need.
3) Include keywords in the Question Title that will attract the right Experts.
4) Provide FULL DETAILS in the question body so the Experts can get right to work on a solution.
5) When an Expert does make a comment, be sure to be responsive.

For more information on Asking Questions, see http://www.cityofangels.com/Experts/Member.htm
For information on how to finalize questions, see: http://www.cityofangels.com/Experts/Closing.htm
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Please DO NOT respond to this automated post.  DO NOT ACCEPT THIS COMMENT AS AN ANSWER.  Thank you for participating at Experts-Exchange.

CleanupGuy -- EE database cleanup volunteer
0
 
LVL 23

Expert Comment

by:Roshan Davis
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by : jacobkristensen  

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Roshan Davis
EE Cleanup Volunteer
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now