Click here to Skip to main content
15,923,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: error LNK2001 Pin
C Mahesh16-Apr-07 0:03
C Mahesh16-Apr-07 0:03 
AnswerRe: error LNK2001 Pin
cppshishu16-Apr-07 0:14
cppshishu16-Apr-07 0:14 
GeneralRe: error LNK2001 Pin
toxcct16-Apr-07 0:36
toxcct16-Apr-07 0:36 
QuestionProgram start (problem) Pin
david bagaturia15-Apr-07 22:53
david bagaturia15-Apr-07 22:53 
AnswerRe: Program start (problem) Pin
CPallini15-Apr-07 23:10
mveCPallini15-Apr-07 23:10 
GeneralRe: Program start (problem) Pin
david bagaturia16-Apr-07 1:09
david bagaturia16-Apr-07 1:09 
QuestionResolution problem with Gdiplus.. Pin
HuddartG15-Apr-07 22:12
HuddartG15-Apr-07 22:12 
AnswerRe: Resolution problem with Gdiplus.. Pin
Mark Salsbery16-Apr-07 6:51
Mark Salsbery16-Apr-07 6:51 
It doesn't make sense that the rotated image would be better quality than not rotated.

I only see three things I'd do differently from your code..

1) I prefer to apply RotateTransfor BEFORE TranslateTransform (seems to give better results to
me).
2) SetSmoothingMode I thought was just for lines/curves but if it applies smoothing to images
I certainly wouldn't want that effect, unless I was specifically smoothening an image.
3) The interpolation mode should be set before any rotation or scaling.

What happens if you do this:

using namespace Gdiplus;

int top_left_x, top_left_y, new_width, new_height;

// Create a Bitmap object based on a given image file
BITMAP *pGDIBitmap = Bitmap::FromFile(filename, TRUE);

// Calculate offsets and new dimensions
GetOffsets(pGDIBitmap, top_left_x, top_left_y, new_width, new_height);

// Create a GDI Plus graphics object
Graphics graphics(pDC->GetSafeHdc( ) );

// Set some properties, to ensure to have a better quality of image
graphics.SetInterpolationMode(InterpolationModeHighQualityBicubic);
//graphics.SetSmoothingMode(SmoothingModeAntiAlias);

// Check for rotation request
if (bRotateImage)
{
// Invoke rotate transform
graphics.RotateTransform(90.0f);
}

// Translate
graphics.TranslateTransform(top_left_x, top_left_y);

// Draw the image
draw_status = graphics.DrawImage(pGdiBitmap, 0.0f , 0.0f, new_width, new_height);

etc, etc. . .


Mark




"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

GeneralRe: Resolution problem with Gdiplus.. Pin
HuddartG16-Apr-07 21:23
HuddartG16-Apr-07 21:23 
GeneralRe: Resolution problem with Gdiplus.. Pin
Mark Salsbery17-Apr-07 6:22
Mark Salsbery17-Apr-07 6:22 
GeneralRe: Resolution problem with Gdiplus.. Pin
HuddartG18-Apr-07 0:52
HuddartG18-Apr-07 0:52 
Question.msi file Pin
prathuraj15-Apr-07 21:53
prathuraj15-Apr-07 21:53 
QuestionRe: .msi file Pin
sthotakura16-Apr-07 7:22
sthotakura16-Apr-07 7:22 
Questionhow to access string table of .lib file from an EXE Pin
GANsJob15-Apr-07 21:33
GANsJob15-Apr-07 21:33 
Questionhow can i debug my dll in officexp Pin
ytfrdfiw15-Apr-07 21:31
ytfrdfiw15-Apr-07 21:31 
AnswerRe: how can i debug my dll in officexp Pin
Gospodin Baron15-Apr-07 22:13
Gospodin Baron15-Apr-07 22:13 
GeneralRe: how can i debug my dll in officexp Pin
ytfrdfiw15-Apr-07 22:26
ytfrdfiw15-Apr-07 22:26 
GeneralRe: how can i debug my dll in officexp Pin
toxcct15-Apr-07 22:29
toxcct15-Apr-07 22:29 
GeneralRe: how can i debug my dll in officexp Pin
ytfrdfiw15-Apr-07 23:26
ytfrdfiw15-Apr-07 23:26 
GeneralRe: how can i debug my dll in officexp Pin
Gospodin Baron15-Apr-07 23:47
Gospodin Baron15-Apr-07 23:47 
GeneralRe: how can i debug my dll in officexp Pin
ytfrdfiw26-Mar-10 3:16
ytfrdfiw26-Mar-10 3:16 
Questionscope in functions Pin
minkowski15-Apr-07 21:21
minkowski15-Apr-07 21:21 
AnswerRe: scope in functions Pin
Programm3r15-Apr-07 21:26
Programm3r15-Apr-07 21:26 
AnswerRe: scope in functions Pin
CPallini15-Apr-07 21:34
mveCPallini15-Apr-07 21:34 
GeneralRe: scope in functions Pin
minkowski15-Apr-07 21:39
minkowski15-Apr-07 21:39 

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.