Originally posted by: Paolo Borlandi
Simply add a CX, CY (origin coord) in the rotating algorithm like this:
Paolo from Italy
Here there is the solution on how to rotate about a point.
nx1 = (int)((x1-CX)*cosine + (y1-CY)*sine);
ny1 = (int)((y1-CY)*cosine - (x1-CX)*sine);
bye
Originally posted by: Anderson
I'm a beginer of VC and now I want to write a program to open some kinds of picture file.But I don't know how to open a file .For example *.bmp,Can you help me .
Originally posted by: LCM
here's the fix:
destDC.SetMapMode(MM_ISOTROPIC);
I was able to verify that using this method would cause a rotated bitmap image to clipped at the bottom raster. In order to fixed the problem i have updated/modified the code that sets the viewport origin of the destination DC.
destDC.SetWindowExt(1,1);
destDC.SetViewportExt(1,-1);
destDC.SetWindowOrg(minx, maxy);
destDC.SetViewportOrg(0, maxY-1); //inserted right after SetWindowOrg.
Originally posted by: Bigus D.
...toast. Could you tell me how I can rotate my toast
after I take it out of the toaster? Also I want to rotate
my car so that it's facing away from the garage door.
Reply
Originally posted by: Thanks
This was amazing.
And, it worked. I've been fighting with this kind of thing for a few hours, and I'm too stupid to do the math myself, and wow.
Reply
Originally posted by: Satya
The code given in the article is not executing. so plese help me in this topic clearly.
Yours Sinceerly,
satya prasad.
ReplyOriginally posted by: chenggp
I use function 3 to rotate bitmap:
HBITMAP paHbm,result;
paHbm =LoadBitmap(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAP1));
COLORREF color = RGB(192,192,192);
result = GetRotatedBitmap(paHbm,1.57,color);
but can't to work? what shall i do?
ReplyOriginally posted by: Irfan
sir,
i need information about how to draw bitmap buttons but i did not find any information from ur site how to draw bitmap buttons please include this topic also in ur site.
Thanks
Originally posted by: Tumypka
int nRowBytes = ((((nWidth * bpp) + nAlign) & ~nAlign) / 8);
It looks like in in case of 16 bit bitmap alignment goes on 2 bytes, not 4. Thus this part of code looks like
int nAlign;
switch(bpp)
{
case 24:
case 32:
nAlign = 31;
break;
case 16:
nAlign = 15;
break;
}
Reply
Originally posted by: Tumypka
It looks like in in case of 16 bit bitmap alignment goes on 2 bytes, not 4. Thus this part of code looks like
int nAlign;
switch(bpp)
{
case 24:
case 32:
nAlign = 31;
break;
case 16:
nAlign = 15;
break;
}
int nRowBytes = ((((nWidth * bpp) + nAlign) & ~nAlign) / 8);
Reply