Click here to Skip to main content
15,894,646 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Rotate rerctangle in Bitmap Pin
raju_shiva17-Aug-10 23:13
raju_shiva17-Aug-10 23:13 
GeneralRe: Rotate rerctangle in Bitmap Pin
CPallini17-Aug-10 23:19
mveCPallini17-Aug-10 23:19 
GeneralRe: Rotate rerctangle in Bitmap Pin
raju_shiva17-Aug-10 23:45
raju_shiva17-Aug-10 23:45 
QuestionRe: Rotate rerctangle in Bitmap Pin
CPallini17-Aug-10 23:54
mveCPallini17-Aug-10 23:54 
AnswerRe: Rotate rerctangle in Bitmap Pin
raju_shiva18-Aug-10 0:16
raju_shiva18-Aug-10 0:16 
GeneralRe: Rotate rerctangle in Bitmap Pin
CPallini18-Aug-10 0:36
mveCPallini18-Aug-10 0:36 
GeneralRe: Rotate rerctangle in Bitmap Pin
raju_shiva18-Aug-10 1:18
raju_shiva18-Aug-10 1:18 
GeneralRe: Rotate rerctangle in Bitmap Pin
CPallini18-Aug-10 1:47
mveCPallini18-Aug-10 1:47 
Something like this

C++
// rotate around center
double phi = atan(1.0) * 2/3; // 30 degrees
int x[4];
int y[4];
x[0] = -x1 * cos(phi) - y2 * sin(phi);
y[0] =  x1 * sin(phi) - y2 * cos(phi);

x[1] = -x1 * cos(phi) + y1 * sin(phi);
y[1] =  x1 * sin(phi) + y1 * cos(phi);

x[2] =  x2 * cos(phi)  + y1 * sin(phi);
y[2] = -x2 * sin(phi) + y1 * cos(phi);

x[3] =  x2 * cos(phi) - y2 * sin(phi);
y[3] = -x2 * sin(phi) - y2 * cos(phi);

for (int i=0; i<4; i++)
{
  x[i] += center.x;
  y[i] += center.y;
}

MoveToEx(pCellInfo->hDC,x[3],y[3],NULL); 
for (int i=0; i<4; i++)
{
  LineTo(pCellInfo->hDC, x[i],y[i]);
}


I suppose.
Smile | :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

GeneralRe: Rotate rerctangle in Bitmap Pin
raju_shiva18-Aug-10 20:54
raju_shiva18-Aug-10 20:54 
GeneralRe: Rotate rerctangle in Bitmap Pin
CPallini18-Aug-10 20:59
mveCPallini18-Aug-10 20:59 
GeneralRe: Rotate rerctangle in Bitmap Pin
Rick York19-Aug-10 15:49
mveRick York19-Aug-10 15:49 
GeneralRe: Rotate rerctangle in Bitmap Pin
CPallini19-Aug-10 21:26
mveCPallini19-Aug-10 21:26 
AnswerRe: Rotate rerctangle in Bitmap Pin
Peter_in_278017-Aug-10 22:00
professionalPeter_in_278017-Aug-10 22:00 
GeneralRe: Rotate rerctangle in Bitmap Pin
raju_shiva17-Aug-10 22:39
raju_shiva17-Aug-10 22:39 
GeneralRe: Rotate rerctangle in Bitmap Pin
Peter_in_278018-Aug-10 12:08
professionalPeter_in_278018-Aug-10 12:08 
GeneralRe: Rotate rerctangle in Bitmap Pin
raju_shiva18-Aug-10 20:55
raju_shiva18-Aug-10 20:55 
QuestionProcess explorer Pin
Sakhalean17-Aug-10 18:45
Sakhalean17-Aug-10 18:45 
AnswerRe: Process explorer Pin
«_Superman_»17-Aug-10 19:05
professional«_Superman_»17-Aug-10 19:05 
AnswerRe: Process explorer Pin
Nuri Ismail17-Aug-10 20:44
Nuri Ismail17-Aug-10 20:44 
GeneralRe: Process explorer Pin
Sakhalean17-Aug-10 23:21
Sakhalean17-Aug-10 23:21 
GeneralRe: Process explorer Pin
Nuri Ismail18-Aug-10 1:41
Nuri Ismail18-Aug-10 1:41 
GeneralRe: Process explorer Pin
Sakhalean18-Aug-10 19:01
Sakhalean18-Aug-10 19:01 
GeneralRe: Process explorer Pin
Nuri Ismail19-Aug-10 0:10
Nuri Ismail19-Aug-10 0:10 
QuestionHow to validate a file path Pin
Danzy8317-Aug-10 10:32
Danzy8317-Aug-10 10:32 
AnswerRe: How to validate a file path Pin
Niklas L17-Aug-10 10:50
Niklas L17-Aug-10 10:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.