Comments

• Here it is how to rotate abuot a point

Posted by Legacy on 01/06/2004 12:00am

Originally posted by: Paolo Borlandi

```Here there is the solution on how to rotate about a point.

Simply add a CX, CY (origin coord) in the rotating algorithm like this:

nx1 = (int)((x1-CX)*cosine + (y1-CY)*sine);
ny1 = (int)((y1-CY)*cosine - (x1-CX)*sine);

bye

Paolo from Italy

```

Reply
• Help me.

Posted by Legacy on 11/18/2003 12:00am

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 .

Reply
• Bug found in Function 2: GetRotatedBitmap() using GetPixel & SetPixel

Posted by Legacy on 11/18/2003 12:00am

Originally posted by: LCM

```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.

here's the fix:

destDC.SetMapMode(MM_ISOTROPIC);
destDC.SetWindowExt(1,1);
destDC.SetViewportExt(1,-1);
destDC.SetWindowOrg(minx, maxy);
destDC.SetViewportOrg(0, maxY-1); //inserted right after SetWindowOrg.

```

Reply
• How do I rotate my...

Posted by Legacy on 11/12/2003 12:00am

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
• Thanks a lot !!

Posted by Legacy on 10/27/2003 12:00am

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
• Rotating the Bitmap Image

Posted by Legacy on 10/18/2003 12:00am

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.

Reply
• How To Use Function 3?about parameter hDIB?

Posted by Legacy on 04/08/2003 12:00am

Originally 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?

Reply
• Bitmap Buttons

Posted by Legacy on 01/24/2003 12:00am

Originally 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

Reply
• Bug in fucntion 3

Posted by Legacy on 11/22/2002 12:00am

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
• Bug in fucntion 3

Posted by Legacy on 11/22/2002 12:00am

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
• Loading, Please Wait ...