Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm using Direct2D to render a PNG image using a ID2D1BitmapRenderTarget and then caling it's GetBitmap() function and rendering the image using ID2D1HwndRenderTarget::DrawBitmap().

Some of the images rendered this way are clear but others appear blurry. I did some research and followed a tutorial to make my application "DPI Aware" but it didn't help.

enter image description here

(sample with a blurry image on the left)

What could cause the rendered image to appear blurry? Has anyone experienced this issue before? What can I do about this?

share|improve this question
    
How about a screenshot? –  ashes999 Dec 2 '12 at 22:38
    
Here is the same PNG file, rendered blurry on the left and clear on the right: img707.imageshack.us/img707/9853/blurx.png –  Jason Dec 2 '12 at 23:03
    
My eyes are not that great, but it doesn't look blurry to me. –  ashes999 Dec 3 '12 at 1:07

1 Answer 1

up vote 3 down vote accepted

I’m not exactly knowledgeable in Direct2D, but you're probably drawing your image on a half-pixel boundary, and you're getting pwned by antialiasing.

Try drawing the first image half a pixel to the bottom right, so instead of doing

Draw(something, x, y);

do something like

Draw(something, x + 0.5, y + 0.5);

Google "Direct2D half pixel" for information on how to do this.

share|improve this answer
    
That did it thanks :x –  Jason Dec 3 '12 at 4:30
    
Glad I could help. –  Panda Pajama Dec 3 '12 at 4:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.