google-code-export / transmission-remote-dotnet

Automatically exported from code.google.com/p/transmission-remote-dotnet
GNU General Public License v3.0
1 stars 1 forks source link

Smoother PiecesGraph #386

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I rewrote the onPaint-method so the PiecesGraph looks more smooth and is 
(propably ;) ) more accurate.

File attached

Original issue reported on code.google.com by xyfr...@googlemail.com on 21 Mar 2011 at 3:27

Attachments:

GoogleCodeExporter commented 9 years ago
Something is wrong with this: if len less than Width, bitsperrow will be less 
than 1. so num_bits will be 0. That's a division by zero...

Original comment by elso.and...@gmail.com on 21 Mar 2011 at 11:32

GoogleCodeExporter commented 9 years ago
Oh yeah you're right ^^;
Sorry about this - fixed.

Original comment by xyfr...@googlemail.com on 21 Mar 2011 at 4:08

Attachments:

GoogleCodeExporter commented 9 years ago
What do you think about this little optimization:

short diffR = (short)(ForeColor.R - BackColor.R);
short diffG = (short)(ForeColor.G - BackColor.G);
short diffB = (short)(ForeColor.B - BackColor.B);

Color fill = Color.FromArgb((int)(BackColor.R + diffR * chunk_done), 
(int)(BackColor.G + diffG * chunk_done), (int)(BackColor.B + diffB * 
chunk_done));

If i calculated good, this is same, but with less multiplication.

Original comment by elso.and...@gmail.com on 12 Apr 2011 at 10:50