Paint.NET

Welcome to the Paint.NET forum!
It is currently Sun Nov 22, 2009 10:50 am

All times are UTC


Forum rules


Please click here to view the forum rules



Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 37 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Paint.NET v3.20 Release Candidate 1 is now available
PostPosted: Tue Dec 11, 2007 4:59 am 
Offline
Paint.NET Lead Developer
User avatar

Joined: Tue Jul 19, 2005 6:22 pm
Posts: 8878
Location: Kirkland, WA
I Like Pi wrote:
I'm using the default DPI settings. I'm saying that the size of the selection changes when I select "Centimeters" after using "Pixels."
Is this intended?

I figured out what it was. The problem is when you convert from pixels-> cm when the image is set up for inches (DPI), or when converting from pixels->inches when the image is set up for centimeters (DPCM).

Care to spot the error in the code? :) This is a new function in the Document class that was written to handle conversion between measurement types when the basis for measurement could be in another unit system entirely. For example, conversion from X number of pixels to Y number of inches when your basis measurement states there are Z pixels per centimeter. More complex than it sounds and I simply got two little things mixed up in the original implementation. Fixed for the final release.
Code:
public static double ConvertMeasurement(
    double sourceLength,
    MeasurementUnit sourceUnits,
    MeasurementUnit basisDpuUnits,
    double basisDpu,
    MeasurementUnit resultDpuUnits)
{
    // ... (bunch of other code here) ...

    // Case 10. Converting from pixels to centimeters, when the basis is in inches.
    if (resultDpuUnits == MeasurementUnit.Centimeter && basisDpuUnits == MeasurementUnit.Inch)
    {
        double dpcm = DotsPerCmToDotsPerInch(basisDpu);
        double resultCm = sourceLength / dpcm;
        return resultCm;
    }

    // Case 11. Converting from pixels to inches, when the basis is in centimeters.
    if (resultDpuUnits == MeasurementUnit.Inch && basisDpuUnits == MeasurementUnit.Centimeter)
    {
        double dpi = DotsPerCmToInchPerCm(basisDpu);
        double resultIn = sourceLength / dpi;
        return resultIn;
    }
}

Hint: The "DotsPer...()" calls are backwards / swapped.

_________________
The Paint.NET Blog: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html
Paint.NET Search Engine: http://searchpaint.net

Image


Top
 Profile  
 
 Post subject: Re: Paint.NET v3.20 Release Candidate 1 is now available
PostPosted: Tue Dec 11, 2007 6:16 pm 
Offline
I won the "Pauly Shore Award for Unfunniness" and all I got was this lousy rank.
User avatar

Joined: Mon Oct 15, 2007 7:39 pm
Posts: 1689
Location: Greater London, UK
It's hardly a bug, but I've noticed something:

Attachment:
15.png
15.png [ 14.29 KiB | Viewed 95 times ]


If you look, it is Plugin Error window. The wiord if is wrriten strangley.

Never happened before so why now (so i guess it's just some sort of mistake)

Anyway, this release is good!
I'm 11 and I have a younger brother who is nearly 2. Whenever he comes near the computer he presses the ON button (therefore if I'm using it, and he presses it, it would shut down.) What I noticed was that when this happened (I was running Paint.NET), it didn't shutdown. Every other programme quit itself however paint.net said "do i wish to save this" and somehow this prevented my shutdown.

1 week later, the samething happened, all other programmes exited and PDN remained.

Weird - something in your code must be causing this (maybe)!

_________________
Image


Top
 Profile  
 
 Post subject: Re: Paint.NET v3.20 Release Candidate 1 is now available
PostPosted: Tue Dec 11, 2007 6:22 pm 
Offline
Site Admin and 2008 "Homer Simpson Award for Humor" Winner
User avatar

Joined: Tue Aug 02, 2005 10:27 pm
Posts: 6662
Location: California, USA Weather: Sunny
vista? wrote:
Whenever he comes near the computer he presses the ON button (therefore if I'm using it, and he presses it, it would shut down.) What I noticed was that when this happened (I was running Paint.NET), it didn't shutdown. Every other programme quit itself however paint.net said "do i wish to save this" and somehow this prevented my shutdown.

1 week later, the samething happened, all other programmes exited and PDN remained.

Weird - something in your code must be causing this (maybe)!

Notepad can do this if you have it open with unsaved changes. When the shutdown event happens a program can capture it and prevent it from happening.

OR,

You can change the behavior of your power button. Start > Control Panel > Power Options > Advanced Tab.

_________________
Warning: The above post contains sarcasm. Use as directed.
Image
BoltBait's Plugin Pack | CodeLab | More... and a Dominoes Computer Game


Top
 Profile  
 
 Post subject: Re: Paint.NET v3.20 Release Candidate 1 is now available
PostPosted: Tue Dec 11, 2007 6:26 pm 
Offline
I won the "Pauly Shore Award for Unfunniness" and all I got was this lousy rank.
User avatar

Joined: Mon Oct 15, 2007 7:39 pm
Posts: 1689
Location: Greater London, UK
Great, not only is Paint.NET an image editing programme, it's also "Anti Shutdown Software"!

(I need a better name for it.) 8) This feature is very useful, especially for me.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Paint.NET v3.20 Release Candidate 1 is now available
PostPosted: Tue Dec 11, 2007 9:30 pm 
Offline
User avatar

Joined: Mon Oct 30, 2006 2:21 pm
Posts: 2028
Location: Lille;France
You also need to think before you (or he) press this button.
It's not linked to Paint.net! Opened and modified documents require to be saved before respective program(s) close itself due to shutdown request.

This is not a safe behave (to press this button)... for your documents, and for the system health IMO...

_________________
Image
My DeviantArt | My Pictorium | My Plugins


Top
 Profile  
 
 Post subject: Re: Paint.NET v3.20 Release Candidate 1 is now available
PostPosted: Thu Dec 13, 2007 1:02 am 
Offline
User avatar

Joined: Fri Dec 08, 2006 8:56 pm
Posts: 5489
Location: 32829 Orlando, FL
Wow, so soon? Can't wait for the next official release 8)

_________________
"The greatest thing about the Internet is that you can write anything you want and give it a false source." ~Jimi Hendrix
Image
twitter | dA | blog


Top
 Profile  
 
 Post subject: Re: Paint.NET v3.20 Release Candidate 1 is now available
PostPosted: Thu Dec 13, 2007 3:07 am 
Offline
Paint.NET Lead Developer
User avatar

Joined: Tue Jul 19, 2005 6:22 pm
Posts: 8878
Location: Kirkland, WA
Closing thread because I'm in the middle of releasing 3.20 Final.

_________________
The Paint.NET Blog: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html
Paint.NET Search Engine: http://searchpaint.net

Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 37 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Hosted by Forumer & phpBB

Get your Forumer™ today!

Adding a forum to your website is a great way to get return visitors.

» Get your own Free Forum!

Terms of Use

Privacy Policy

Report Abuse

Copyright © 2003-2009 Forumer. All Rights Reserved. | Copyright © paint.NET