Click here to Skip to main content
15,891,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: GDIplus [modified] Pin
john563218-Aug-10 0:29
john563218-Aug-10 0:29 
GeneralRe: GDIplus Pin
Nuri Ismail18-Aug-10 1:17
Nuri Ismail18-Aug-10 1:17 
GeneralRe: GDIplus Pin
Henri Socha16-Dec-10 10:14
Henri Socha16-Dec-10 10:14 
AnswerRe: GDIplus Pin
CPallini17-Aug-10 23:32
mveCPallini17-Aug-10 23:32 
QuestionMessage Removed Pin
17-Aug-10 22:58
edward barbu17-Aug-10 22:58 
QuestionRe: Question about IOleObject::GetClipboardData Pin
Cool_Dev17-Aug-10 23:43
Cool_Dev17-Aug-10 23:43 
QuestionCode-Generation Setting Pin
gothic_coder17-Aug-10 22:32
gothic_coder17-Aug-10 22:32 
AnswerRe: Code-Generation Setting Pin
ShilpiP18-Aug-10 1:09
ShilpiP18-Aug-10 1:09 
GeneralRe: Code-Generation Setting Pin
gothic_coder18-Aug-10 1:16
gothic_coder18-Aug-10 1:16 
GeneralRe: Code-Generation Setting Pin
ShilpiP18-Aug-10 1:17
ShilpiP18-Aug-10 1:17 
GeneralRe: Code-Generation Setting Pin
gothic_coder18-Aug-10 1:27
gothic_coder18-Aug-10 1:27 
GeneralRe: Code-Generation Setting Pin
ShilpiP18-Aug-10 2:21
ShilpiP18-Aug-10 2:21 
GeneralRe: Code-Generation Setting Pin
gothic_coder18-Aug-10 2:42
gothic_coder18-Aug-10 2:42 
GeneralRe: Code-Generation Setting Pin
ShilpiP18-Aug-10 3:10
ShilpiP18-Aug-10 3:10 
GeneralRe: Code-Generation Setting Pin
Rick York19-Aug-10 20:19
mveRick York19-Aug-10 20:19 
GeneralRe: Code-Generation Setting Pin
gothic_coder19-Aug-10 22:37
gothic_coder19-Aug-10 22:37 
QuestionEmail config setting. Pin
Samarjeet Singh@india17-Aug-10 21:40
Samarjeet Singh@india17-Aug-10 21:40 
AnswerRe: Email config setting. Pin
Richard MacCutchan17-Aug-10 22:27
mveRichard MacCutchan17-Aug-10 22:27 
GeneralRe: Email config setting. Pin
Samarjeet Singh@india17-Aug-10 22:31
Samarjeet Singh@india17-Aug-10 22:31 
GeneralRe: Email config setting. Pin
Richard MacCutchan18-Aug-10 1:15
mveRichard MacCutchan18-Aug-10 1:15 
QuestionRotate rerctangle in Bitmap Pin
raju_shiva17-Aug-10 21:32
raju_shiva17-Aug-10 21:32 
Hi sir,
I have origin axis of bitmap 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.
Can some one help me

double x1,x2,y1,y2;
sf=(1024/31);  //Its a bitmap image
A1 = 10.00; //these are values i am reading from hardware
A2 = 10.00;
B1 = 10.00;
B2 = 10.00;

x1 = (A1 * sf);
x2 = (A2 * sf);
y1 = (B1 * sf);
y2 = (B2 * sf);
//To find the center origin of Bitmap
center.x=(((pCellInfo->rcBitmapRect.right-pCellInfo->rcBitmapRect.left)/2)+pCellInfo->rcBitmapRect.left);
center.y=(((pCellInfo->rcBitmapRect.bottom-pCellInfo->rcBitmapRect.top)/2)+pCellInfo->rcBitmapRect.top);

int a = 45; 
float Angle = ( 3.142 * a ) / 180; 

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);

//I am using the right formula to claculate the axis for rotation
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
QuestionRe: Rotate rerctangle in Bitmap Pin
CPallini17-Aug-10 21:58
mveCPallini17-Aug-10 21:58 
AnswerRe: Rotate rerctangle in Bitmap Pin
raju_shiva17-Aug-10 22:38
raju_shiva17-Aug-10 22:38 
GeneralRe: Rotate rerctangle in Bitmap Pin
CPallini17-Aug-10 22:49
mveCPallini17-Aug-10 22:49 
GeneralRe: Rotate rerctangle in Bitmap Pin
raju_shiva17-Aug-10 23:13
raju_shiva17-Aug-10 23:13 

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.