This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.
Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Jack  
#1 Posted : Tuesday, August 29, 2006 7:02:55 PM(UTC)
Jack

Rank: Member

Groups: Member
Joined: 6/26/2006(UTC)
Posts: 3

How can I resize an image in cm preserving the same DPI?

I have to calculate the width an height (in pixels) in order to fit the size in cm?

I suppose it will exist some more direct transformation to achieve this goal?

Thanks in advance,

Eduard.

Dmitry  
#2 Posted : Tuesday, August 29, 2006 8:31:35 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello Eduard,

You can specify new width and height of resize transformation in pixels. Here is small code sample:

Code:
Aurigma.GraphicsMill.Transforms.Resize resize = new Aurigma.GraphicsMill.Transforms.Resize();
resize.Unit = Aurigma.GraphicsMill.Unit.Cm;
resize.Width = 2.0f;
resize.Height = 2.0f;
resize.ResizeMode = Aurigma.GraphicsMill.Transforms.ResizeMode.Fit;
resize.ApplyTransform(bmp);
	
bmp.Save(@"d:/temp/ResizeInCm.jpg");

This code sample preserves resolution of original bitmap.

Edited by user Wednesday, December 19, 2007 2:57:53 PM(UTC)  | Reason: Not specified

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

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.