Win32 Programming


  • 1. Graphs
    I need to map some data from sql server to a graph with points and create a line graph. Multiple lines on a graph. I'm an asp.Net programmer. this needs to be in a web page in Anything out there that would easily let me do that in dot net? -- Chris Davoli
  • 2. Please Explain GDI+ Philosophy.
    Hi Folks: I've been using GDI+ for a little while, and I keep running into something that I don't understand. Right now the issue is fonts. But other GDI+ classes also exhibit this. The app has a class which describes a dialog with, among other things, a pair of Fonts. I'd like to make these class variables each a Font, instead of pointer to a Font. That way the Font will go away when the class is deleted. While servicing the WM_INITDIALOG message this class is instantiated before I know the nature of these two Fonts. After doing some setup for the dialog I'm ready to fill the two Fonts with the information found in the Font::Font(WCHAR*,REAL,INT,Unit,FontCollection*) constructor. But, of course, I can't. I have to make the Fonts pointers and perform "new" operations, with the constructor. Which means I have to explicitly delete these new Font instances. This isn't a big deal, but I have to do it for so many of the GDI+ classes. This approach is further enforced by the methods for Fonts, and other classes. GetFamily(), GetHeight(), get whatever are there, but there are no corresponding set function This approach is obviously intentional, and probably done for a very good reason. Anybody care to tell me what it is? Thanks Larry
  • 3. Storing .JPG image files with data...
    Hello, I need to create a file that would store personal information about a person, for example: name, addess, phone number, gender and age. But also I need to store a .JPG image file of each person that can be retrieved along with the pertinent personal information. So, my questions are: Is there a file system that would allow me to store text, numbers and image files for each person in the same file ? If not, How can I store the .JPG image files separately ? Thanks.
  • 4. About devmode structure
    Hi all, am new to printer driver programming.Please explain abt devmode.I m not able to understanding fully,What I understood so far is there are Public & private devmode vatriables. iNeed to know what is the use of it, and how it works with an application(for eg,how printer recognizes thet it needs to print in landscape).


Postby Raluca Ioan » Thu, 06 Oct 2005 20:36:37 GMT

I have to set font height for a custom control of mine.
If I specify it like "8" or "11", the obtained text doesn't look ok at all.
I saw the height of the font specified like this: -MulDiv(11,
GetDeviceCap(hDC, LOGPIXELSY), 72) instead, but, i don't now why,

could you please tell me how to use GetDeviceCaps, and why is 72 used...?


Re: GetDeviceCaps

Postby Mike D Sutton » Thu, 06 Oct 2005 22:42:17 GMT

>I have to set font height for a custom control of mine.

In what way does it not look ok?  Some fonts are created at specific sizes and will display badly at other point sizes, vector fonts 
will also only anti-alias when the point size gets large enough so you may be seeing very aliased (jaggy edges) on text at these 

The mapping mode of the target DC must be set to MM_TEXT for this to work, by multiplying the point size by the number of pixels per 
logical inch and dividing by 72 you get the font height in pixels for the given point size.  By specifying this as a negative 
parameter it instructs the font mapper to map against the character rather than cell height.  For more information have a look at 
fonts in GDI in the MSDN.
Hope this helps,


 - Microsoft Visual Basic MVP -
WWW:  http://www.**--****.com/ 

Return to Win32 Programming


Who is online

Users browsing this forum: No registered users and 99 guest