Click here to Skip to main content
15,886,362 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DLL and STL in function parameters Pin
beko17-Aug-10 2:10
beko17-Aug-10 2:10 
GeneralRe: DLL and STL in function parameters Pin
Aescleal17-Aug-10 2:54
Aescleal17-Aug-10 2:54 
GeneralRe: DLL and STL in function parameters Pin
beko17-Aug-10 3:22
beko17-Aug-10 3:22 
GeneralRe: DLL and STL in function parameters Pin
Aescleal17-Aug-10 3:28
Aescleal17-Aug-10 3:28 
Questionprocessor time Pin
AbhiHcl16-Aug-10 19:51
AbhiHcl16-Aug-10 19:51 
AnswerRe: processor time Pin
Aescleal16-Aug-10 21:03
Aescleal16-Aug-10 21:03 
AnswerRe: processor time Pin
Moak17-Aug-10 0:55
Moak17-Aug-10 0:55 
QuestionHow to rotate a rectangle in Bitmap Pin
raju_shiva16-Aug-10 19:27
raju_shiva16-Aug-10 19:27 
Hi sir,
I have origin axis and x1,x2,y1,y2.
I want to draw a rectangle and rotate it with the given degree.I am trying with this code,but i am not getting.

Her is the code

double x1,x2,y1,y2;
sf=(1024/31);
A1 = 10.00;
A2 = 10.00;
B1 = 10.00;
B2 = 10.00;

	x1 = (A1 * sf);
	x2 = (A2 * sf);
	y1 = (B1 * sf);
	y2 = (B2 * sf);

float Angle = 45.0;

x1 =  x1 * cos(Angle) + y1 * sin(Angle); 
y1 = -x1 * sin(Angle) + y1 * cos(Angle);
x2 =  x2 * cos(Angle) + y2 * sin(Angle); 
y2 = -x2 * sin(Angle) + y2 * cos(Angle);

Origin(525,454);  // center origin(center.x,center.y);
MoveToEx(pCellInfo->hDC,center.x-x1,center.y-y2,NULL);

LineTo(pCellInfo->hDC,center.x-x1,center.y+y1);
	LineTo(pCellInfo->hDC,center.x+x2,center.y+y1);
	LineTo(pCellInfo->hDC,center.x+x2,center.y-y2);
	LineTo(pCellInfo->hDC,center.x-x1,center.y-y2);

If i test with this hard code values,i am getting the rectangle rotated
MoveToEx(pCellInfo->hDC,525,289,NULL);// Angle 45 for reference
	LineTo(pCellInfo->hDC,360,454);
	LineTo(pCellInfo->hDC,525,619);
	LineTo(pCellInfo->hDC,690,454);
	LineTo(pCellInfo->hDC,525,289); 

how can i get the same values


Thanks
Raj

Can some one help me
AnswerRe: How to rotate a rectangle in Bitmap Pin
Peter_in_278016-Aug-10 20:32
professionalPeter_in_278016-Aug-10 20:32 
GeneralRe: How to rotate a rectangle in Bitmap Pin
raju_shiva16-Aug-10 22:57
raju_shiva16-Aug-10 22:57 
QuestionReading Directory Pin
Fareed Rizkalla16-Aug-10 16:18
Fareed Rizkalla16-Aug-10 16:18 
AnswerRe: Reading Directory Pin
Cool_Dev16-Aug-10 18:09
Cool_Dev16-Aug-10 18:09 
AnswerRe: Reading Directory Pin
«_Superman_»16-Aug-10 18:16
professional«_Superman_»16-Aug-10 18:16 
GeneralRe: Reading Directory Pin
Aescleal16-Aug-10 21:06
Aescleal16-Aug-10 21:06 
GeneralRe: Reading Directory Pin
«_Superman_»16-Aug-10 21:43
professional«_Superman_»16-Aug-10 21:43 
GeneralRe: Reading Directory Pin
Aescleal17-Aug-10 5:30
Aescleal17-Aug-10 5:30 
QuestionReading CPU Temperature (including each core temperature) without third party tools Pin
ant-damage16-Aug-10 11:21
ant-damage16-Aug-10 11:21 
AnswerRe: Reading CPU Temperature (including each core temperature) without third party tools Pin
Fareed Rizkalla16-Aug-10 16:18
Fareed Rizkalla16-Aug-10 16:18 
GeneralRe: Reading CPU Temperature (including each core temperature) without third party tools [modified] Pin
ant-damage17-Aug-10 1:17
ant-damage17-Aug-10 1:17 
QuestionRe: Reading CPU Temperature (including each core temperature) without third party tools Pin
David Crow17-Aug-10 8:44
David Crow17-Aug-10 8:44 
AnswerRe: Reading CPU Temperature (including each core temperature) without third party tools Pin
ant-damage17-Aug-10 11:08
ant-damage17-Aug-10 11:08 
GeneralRe: Reading CPU Temperature (including each core temperature) without third party tools Pin
JudyL_MD17-Aug-10 12:31
JudyL_MD17-Aug-10 12:31 
QuestionMFC: Can popup dialog in SDI app access ribbon commands? Pin
Jamie Kenyon16-Aug-10 9:25
Jamie Kenyon16-Aug-10 9:25 
AnswerRe: MFC: Can popup dialog in SDI app access ribbon commands? Pin
«_Superman_»16-Aug-10 18:27
professional«_Superman_»16-Aug-10 18:27 
Questionunable to install htk tool kit Pin
aspirant a16-Aug-10 7:42
aspirant a16-Aug-10 7:42 

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.