 |
|
|
 |
|
 |
if you set back color with white color, destinition bitmap have many black lines in the non-bitmap region.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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"
|
| Sign In·View Thread·PermaLink | 4.33/5 |
|
|
|
 |
|
 |
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))));
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
 |
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?
|
| Sign In·View Thread·PermaLink | 1.60/5 |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
 |
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...
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
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?
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | 2.67/5 |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
u can load the picture into texture, then use d3d or opengl to map it to any shape. it is faster than software algorithms.
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
 |
I want to know about this rotate algorithm..... NO SOURCE... Please give me... related paper or book
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |