Click here to Skip to main content
15,921,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Why don't run the same programe code on vc++ compiler Pin
Toni783-Jun-03 19:51
Toni783-Jun-03 19:51 
GeneralRe: Why don't run the same programe code on vc++ compiler Pin
Christian Graus3-Jun-03 19:54
protectorChristian Graus3-Jun-03 19:54 
GeneralRe: Why don't run the same programe code on vc++ compiler Pin
Toni783-Jun-03 20:03
Toni783-Jun-03 20:03 
GeneralRe: Why don't run the same programe code on vc++ compiler Pin
sunjohn3-Jun-03 20:23
sunjohn3-Jun-03 20:23 
GeneralRe: Why don't run the same programe code on vc++ compiler Pin
Christian Graus3-Jun-03 20:25
protectorChristian Graus3-Jun-03 20:25 
GeneralRe: Why don't run the same programe code on vc++ compiler Pin
sunjohn3-Jun-03 20:51
sunjohn3-Jun-03 20:51 
GeneralA question about GDI+ Pin
Anonymous3-Jun-03 13:53
Anonymous3-Jun-03 13:53 
GeneralRe: A question about GDI+ Pin
ucs3-Jun-03 23:56
ucs3-Jun-03 23:56 
Hi if you want to make a simple rotation (90, 180, 270 or flip), you can use :

pBmp->RotateFlip(Rotate180FlipNone);
// Rotate180FlipNone is an exemple


if you want to rotate it, use this

Bitmap* Rotate ( Bitmap* pSrcBmp, REAL rRot )
{
int w = pSrcBmp->GetWidth();
int h = pSrcBmp->GetHeight();
Bitmap* pDstBmp = new Bitmap( (w+h)*2, (w+h)*2, PixelFormat32bppARGB );
// (w+h)*2 max width and height, you can optimize it(?)

Graphics graphics(pDstBmp);
graphics.Clear(Color(0,255,255,255));
Pen pen(Color(255, 255, 0, 0));
graphics.TranslateTransform((REAL)w+h, (REAL)w+h);
graphics.RotateTransform(rRot);
graphics.DrawImage(pSrcBmp, 0, 0);

return pDestBmp;
}

save this image with
{
GetCodecClsid(L"image/tiff", &mClsid);
// you can use L"image/jpeg", L"image/gif", ...
pBmp->Save(L"img.tif", &mClsid);
}

int GetCodecClsid(const WCHAR* format, CLSID* pClsid)
{

UINT num = 0; // number of image encoders
UINT size = 0; // size of the image encoder array in bytes

ImageCodecInfo* pImageCodecInfo = NULL;

GetImageEncodersSize(&num, &size);
if(size == 0)
return -1; // Failure

pImageCodecInfo = (ImageCodecInfo*)(malloc(size));
if(pImageCodecInfo == NULL)
return -1; // Failure

GetImageEncoders(num, size, pImageCodecInfo);

for(UINT j = 0; j < num; ++j)
{
if( wcscmp(pImageCodecInfo[j].MimeType, format) == 0 )
{
*pClsid = pImageCodecInfo[j].Clsid;
return j; // Success
}
} // for

return -1; // Failure
}
GeneralRe: A question about GDI+ Pin
Anonymous4-Jun-03 4:22
Anonymous4-Jun-03 4:22 
GeneralOne more question Pin
Anonymous4-Jun-03 6:02
Anonymous4-Jun-03 6:02 
GeneralRe: One more question Pin
ucs4-Jun-03 12:46
ucs4-Jun-03 12:46 
GeneralRegistry HELP Pin
yoshi113-Jun-03 13:19
yoshi113-Jun-03 13:19 
GeneralRe: Registry HELP Pin
valikac3-Jun-03 13:27
valikac3-Jun-03 13:27 
GeneralRe: Registry HELP Pin
olinn3-Jun-03 17:14
olinn3-Jun-03 17:14 
GeneralTimer Pin
act_x3-Jun-03 12:35
act_x3-Jun-03 12:35 
GeneralRe: Timer Pin
valikac3-Jun-03 13:29
valikac3-Jun-03 13:29 
GeneralCSocket possible bug on win2k Pin
ucs3-Jun-03 12:32
ucs3-Jun-03 12:32 
GeneralRe: CSocket possible bug on win2k Pin
olinn3-Jun-03 17:30
olinn3-Jun-03 17:30 
GeneralRe: CSocket possible bug on win2k Pin
ucs3-Jun-03 23:57
ucs3-Jun-03 23:57 
GeneralRe: CSocket possible bug on win2k Pin
olinn4-Jun-03 0:59
olinn4-Jun-03 0:59 
GeneralEdit controls and fonts Pin
Steven M Hunt3-Jun-03 11:41
Steven M Hunt3-Jun-03 11:41 
GeneralRe: Edit controls and fonts Pin
Michael Pauli3-Jun-03 13:15
Michael Pauli3-Jun-03 13:15 
GeneralThanks! Pin
Steven M Hunt3-Jun-03 14:33
Steven M Hunt3-Jun-03 14:33 
GeneralTrouble reading from a file. Pin
rassad3-Jun-03 11:33
rassad3-Jun-03 11:33 
GeneralRe: Trouble reading from a file. Pin
Peter Weyzen3-Jun-03 11:44
Peter Weyzen3-Jun-03 11:44 

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.