Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
kenberkun  
#1 Posted : Thursday, February 17, 2005 4:17:00 PM(UTC)
kenberkun

Rank: Member

Groups: Member
Joined: 1/5/2005(UTC)
Posts: 20

I'm trying to set the unit to inches, but it seems to always stay stuck in pixels. Here is my code in C++:

Code:
		piBitmap->put_Unit(UnitInch);		
		double myHeight, myWidth;
		enum Unit myUnit;
		piBitmap->get_Unit(&myUnit);
		ATLTRACE2("myUnit = %d\n",myUnit);
		piBitmapData->get_ScaleHeight(&myHeight);
		piBitmapData->get_ScaleWidth(&myWidth);
		ATLTRACE2("Width = %f ",myWidth);
		ATLTRACE2("Height = %f\n", myHeight);


the first trace shows the get_unit returns the correct result ("2" = UnitInch), but the last two traces print out the results in pixels not inches.

Thanks,
ken

Edited by user Monday, December 24, 2007 4:11:36 PM(UTC)  | Reason: Not specified

Andrew  
#2 Posted : Friday, February 18, 2005 1:56:00 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 863

Thanks: 2 times
Was thanked: 25 time(s) in 25 post(s)
Hello Ken,

The physical size (in inches or other real-world units) depends on the resolution (dots per inch - DPI) of the bitmap. If the resolution is 300 DPI, it means that the physical size of, say, 600x600 pixels is 2x2 inches. If the resolution is 100 DPI, the same bitmap will have physical size 6x6 inches.

It is most likely that the image you test has wrong resolution values (1 DPI). Check HorizontalResolution and VerticalResolution properties.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.