 |
|
 |
the design of the page is not good ...
|
|
|
|
 |
|
 |
if you set back color with white color, destinition bitmap have many black lines in the non-bitmap region.
|
|
|
|
 |
|
 |
I think the code has some serious bug on pixel handling at the edge of source image, to reproduce this, try to set the background color to white, and rotate, and observe: (I did this with the demo program)
1. there are 2 unwanted lines in the rotated image. 2. the edges of source image in the rotated image are aliased which makes it hardly "high quality"
|
|
|
|
 |
|
 |
Fixed it!
The problem was this: Consider a bitmap pixel on the edge of an all-red bitmap drawn on a blue background. Let's say the bitmap is rotated in such a way that the image covers 75% of this pixel. What the original code does is it draws this pixel at 75% red - which is wrong! It should draw it 75% red PLUS 25% blue. Drawing just 75% red is implicitly drawing 75% red plus 25% black, and this explains the black lines around the image.
The fix: In the HorizSkew() and VertSkew() functions, change:
COLORREF pxlLeft = RGB (BYTE ( double (GetRValue (pxlSrc)) * dWeight ), BYTE ( double (GetGValue (pxlSrc)) * dWeight ), BYTE ( double (GetBValue (pxlSrc)) * dWeight ));
to:
COLORREF pxlLeft = RGB (BYTE ( (double (GetRValue (pxlSrc)) * dWeight) + (double(GetRValue(clrBack)) * (1.0 - dWeight)) ), BYTE ( (double (GetGValue (pxlSrc)) * dWeight) + (double(GetGValue(clrBack)) * (1.0 - dWeight))), BYTE ( (double (GetBValue (pxlSrc)) * dWeight) + (double(GetBValue(clrBack)) * (1.0 - dWeight))));
|
|
|
|
 |
|
 |
I have created a control on a Dialog. I have set a BMP on that Control. Now I want to rotate that control.
Please tell me how can I do that?
|
|
|
|
 |
|
|
 |
|
 |
the source file download link can not use can you upload it on codeproject
|
|
|
|
 |
|
 |
I just tried the link, it works fine.
|
|
|
|
 |
|
 |
The link does not work for me
|
|
|
|
 |
|
 |
The link is: http://antontreskunov.home.comcast.net/Anton/Software/ Anton Treskunov
|
|
|
|
 |
|
|
 |
|
 |
Sir: Can you tell me how to get a .ppm file from a bitmap(.bmp)? Thanks!! Alan Shen
|
|
|
|
 |
|
 |
1, Extract RGB data from bitmap. Be careful about scanline zero padding if it is not divisable by 4 2, Write the PPM header as well as the extracted data to a file. The extracted data should be start in next row
The PPM header can be like for bin data file
P6 640 480 255
|
|
|
|
 |
|
 |
I want to rotate a bmp image about its own axes. But this code is not working for bmp. Can someone help me. Please is urgent for me.
Vaibhav...
|
|
|
|
 |
|
 |
It tries to open PPM format. I cant workout it for BMP. Have u had a chance to solve it by this time.
----------------------------------------------------------- In my dream, I was dorwning my §orrow§ But my §orrow§, they learned to §wim
|
|
|
|
 |
|
 |
Is there any white paper describing this shear rotation algorithm? I want to rotate an alpha-channel image and put it over another image with a quality of Photoshop rotation. Is it possible?
|
|
|
|
 |
|
 |
I have been doing a bit of work on the "RotationByShear" package. I currently have "version 2" ready to upload, if anyone thinks they might find it useful.
The changes that I have made are mainly:
1. Added independent x and y scale factors (stretch/shrink) that can be used instead of (or in addition to) the rotation on the same call.
2. Corrected some minor bugs.
3. Converted the project files to MS-VC++ v7.
I could also easily add independent x and y shear angles, either before or after the rotation & scaling (without any extra passes), but I don't know if there is any interest in that?
PS. I also found a nicely written "white paper" that complements this package.
land_lubber
|
|
|
|
 |
|
|
 |
|
 |
Eran,
That's a nice image, who is it?
Just curious, Alvaro

|
|
|
|
 |
|
|
 |
|
 |
Can U publish shrink code???
Thank you publishing the article.
|
|
|
|
 |
|
 |
It is very nice Code. Hats off to U. But i've a question that how can i use the algorithm to stretch the Bitmap to a non-rectangular shape? What kind of modifiecations are required on this?
Thanx,
Subbi.
|
|
|
|
 |
|
 |
Check out Aaform to transform a rectangular image into any quadralateral
|
|
|
|
 |
|
 |
u can load the picture into texture, then use d3d or opengl to map it to any shape. it is faster than software algorithms.
|
|
|
|
 |
|
 |
I want to know about this rotate algorithm..... NO SOURCE... Please give me... related paper or book
|
|
|
|
 |