CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    Join Date
    May 1999
    Location
    West Sussex, England
    Posts
    1,939

    Re: How to create DC with specific resolution?

    This should do what you need, at a first attempt (not tested)

    Code:
     int dpiX = dc.GetDeviceCaps(LOGPIXELSX);
     int dpiY = dc.GetDeviceCaps(LOGPIXELSY);
    
     double xScale = requiredDpi / dpiX;
     double yScale = requiredDpi / dpiY;
    
     XFORM format;
     format.eM11 = xScale;
     format.eM12 = 0.0;
     format.eM21 = 0.0;
     format.eM22 = yScale;
    
     SetWorldTransform(dc.GetSfaeHdc(), &format);
    Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
    Please remember to rate useful answers. It lets us know when a question has been answered.

  2. #17
    Join Date
    Oct 2004
    Posts
    481

    Re: How to create DC with specific resolution?

    Hi RogerAllen,

    Thanks again for the help

    I have tested your code and the quality of the image is still the same with 96dpi. What I really want to achive is to get the bitmap contains 200dots per inch instead of 96dots per inch.

    Do you think it is possible? I am really stuck. Please help...

    Thanks for any help again, in advance.

    Cheers

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured