Click here to Skip to main content
15,903,203 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: return value - destructor call? Pin
Nemanja Trifunovic22-Jun-07 3:03
Nemanja Trifunovic22-Jun-07 3:03 
GeneralRe: return value - destructor call? Pin
zqueezy22-Jun-07 3:24
zqueezy22-Jun-07 3:24 
GeneralRe: return value - destructor call? Pin
Nemanja Trifunovic22-Jun-07 3:28
Nemanja Trifunovic22-Jun-07 3:28 
AnswerRe: return value - destructor call? Pin
Iain Clarke, Warrior Programmer22-Jun-07 3:03
Iain Clarke, Warrior Programmer22-Jun-07 3:03 
AnswerRe: return value - destructor call? Pin
Taka Muraoka22-Jun-07 3:06
Taka Muraoka22-Jun-07 3:06 
GeneralRe: return value - destructor call? Pin
zqueezy22-Jun-07 3:14
zqueezy22-Jun-07 3:14 
AnswerRe: return value - destructor call? Pin
zqueezy25-Jun-07 11:27
zqueezy25-Jun-07 11:27 
QuestionRotating Bitmaps !!!! Pin
Adno22-Jun-07 2:43
Adno22-Jun-07 2:43 
Im using this method needless to say is not working and need some help.

void rotateb(Bitmap* image, HDC dc){<br />
	Graphics graphics(dc);<br />
	Bitmap* SrcBitmap1 = image;<br />
	Color mc;<br />
<br />
	int angle=45;        //45° for example <br />
	//Convert degrees to radians <br />
	float radians=(2*3.1416*angle)/360; <br />
<br />
	float cosine=(float)cos(radians); <br />
	float sine=(float)sin(radians); <br />
<br />
	float Point1x=(-SrcBitmap1->GetHeight()*sine); <br />
	float Point1y=(SrcBitmap1->GetHeight()*cosine); <br />
	float Point2x=(SrcBitmap1->GetWidth()*cosine-SrcBitmap1->GetHeight()*sine); <br />
	float Point2y=(SrcBitmap1->GetHeight()*cosine+SrcBitmap1->GetWidth()*sine); <br />
	float Point3x=(SrcBitmap1->GetWidth()*cosine); <br />
	float Point3y=(SrcBitmap1->GetWidth()*sine); <br />
<br />
<br />
	float minx=min(0,min(Point1x,min(Point2x,Point3x))); <br />
	float miny=min(0,min(Point1y,min(Point2y,Point3y))); <br />
	float maxx=max(Point1x,max(Point2x,Point3x)); <br />
	float maxy=max(Point1y,max(Point2y,Point3y)); <br />
<br />
	int DestBitmapWidth=(int)ceil(fabs(maxx)-minx); <br />
	int DestBitmapHeight=(int)ceil(fabs(maxy)-miny);<br />
<br />
	Bitmap* DestBitmap = new Bitmap(DestBitmapWidth, DestBitmapHeight);<br />
<br />
	//----------<br />
	for(int x=0;x<DestBitmapWidth;x++) <br />
	{ <br />
	  for(int y=0;y<DestBitmapHeight;y++) <br />
	  { <br />
		int SrcBitmapx=(int)((x+minx)*cosine+(y+miny)*sine); <br />
		int SrcBitmapy=(int)((y+miny)*cosine-(x+minx)*sine); <br />
		if(SrcBitmapx>=0&&SrcBitmapx<SrcBitmap1->GetWidth() && SrcBitmapy>= 0 && <br />
			 SrcBitmapy<SrcBitmap1->GetHeight()) <br />
		{ <br />
			SrcBitmap1->GetPixel(SrcBitmapx,SrcBitmapy,&mc);<br />
			DestBitmap->SetPixel(x,y,mc);<br />
		} <br />
	  } <br />
	} <br />
<br />
	graphics.DrawImage(DestBitmap,0, 0); <-- this does not <br />
	//graphics.DrawImage(SrcBitmap1,0,0); <-- this displays <br />
}


Thank you
AnswerRe: Rotating Bitmaps !!!! Pin
rrrado22-Jun-07 3:05
rrrado22-Jun-07 3:05 
AnswerRe: Rotating Bitmaps !!!! Pin
Mark Salsbery22-Jun-07 5:55
Mark Salsbery22-Jun-07 5:55 
GeneralRe: Rotating Bitmaps !!!! Pin
Adno22-Jun-07 7:34
Adno22-Jun-07 7:34 
GeneralRe: Rotating Bitmaps !!!! Pin
Mark Salsbery22-Jun-07 7:58
Mark Salsbery22-Jun-07 7:58 
GeneralRe: Rotating Bitmaps !!!! Pin
Adno22-Jun-07 8:20
Adno22-Jun-07 8:20 
QuestionRemoving Redundant Functions Pin
[d3m0n]22-Jun-07 2:42
[d3m0n]22-Jun-07 2:42 
AnswerRe: Removing Redundant Functions Pin
zqueezy22-Jun-07 3:25
zqueezy22-Jun-07 3:25 
GeneralRe: Removing Redundant Functions Pin
[d3m0n]22-Jun-07 3:50
[d3m0n]22-Jun-07 3:50 
QuestionRe: Removing Redundant Functions Pin
David Crow22-Jun-07 4:45
David Crow22-Jun-07 4:45 
AnswerRe: Removing Redundant Functions Pin
[d3m0n]22-Jun-07 5:09
[d3m0n]22-Jun-07 5:09 
QuestionRe: Removing Redundant Functions Pin
David Crow22-Jun-07 5:52
David Crow22-Jun-07 5:52 
AnswerRe: Removing Redundant Functions Pin
Arris7422-Jun-07 7:47
Arris7422-Jun-07 7:47 
AnswerRe: Removing Redundant Functions Pin
[d3m0n]22-Jun-07 8:01
[d3m0n]22-Jun-07 8:01 
QuestionVideo Rendering using DirectShow Pin
Maynka22-Jun-07 2:25
Maynka22-Jun-07 2:25 
AnswerRe: Video Rendering using DirectShow Pin
Mark Salsbery22-Jun-07 6:07
Mark Salsbery22-Jun-07 6:07 
GeneralRe: Video Rendering using DirectShow Pin
Maynka22-Jun-07 21:38
Maynka22-Jun-07 21:38 
QuestionResizing list control with window and splitter control Pin
neha.agarwal2722-Jun-07 1:25
neha.agarwal2722-Jun-07 1:25 

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.