Click here to Skip to main content
16,007,687 members
Home / Discussions / C#
   

C#

 
GeneralRe: DRAW N-sided polygon Pin
Colin Angus Mackay18-Sep-04 15:33
Colin Angus Mackay18-Sep-04 15:33 
GeneralRe: DRAW N-sided polygon Pin
Your dog wants steak18-Sep-04 16:20
Your dog wants steak18-Sep-04 16:20 
GeneralRe: DRAW N-sided polygon Pin
Colin Angus Mackay18-Sep-04 16:43
Colin Angus Mackay18-Sep-04 16:43 
GeneralRe: DRAW N-sided polygon Pin
yoaz19-Sep-04 1:07
yoaz19-Sep-04 1:07 
GeneralRe: DRAW N-sided polygon Pin
Colin Angus Mackay19-Sep-04 2:08
Colin Angus Mackay19-Sep-04 2:08 
GeneralRe: DRAW N-sided polygon Pin
yoaz19-Sep-04 4:41
yoaz19-Sep-04 4:41 
GeneralRe: DRAW N-sided polygon Pin
Colin Angus Mackay19-Sep-04 4:57
Colin Angus Mackay19-Sep-04 4:57 
GeneralImage enlarging quality Pin
Kryal18-Sep-04 13:12
Kryal18-Sep-04 13:12 
I'm having problems enlarging images using the Graphics object. The quality of the enlarged images is bad. I get the best results by setting the interpolation mode to nearest neighbor and pixel offset mode to high quality. Even then, the image is grainy. Here's an example:

protected override void OnPaint(PaintEventArgs e)
{
if(this.image != null)
{
RectangleF source = new RectangleF(0f,0f,0f,0f)
RectangleF dest = new RectangleF(0f,0f,0f,0f)
dest.X = e.ClipRectangle.X;
dest.Y = e.ClipRectangle.Y;
dest.Width = e.ClipRectangle.Width;
dest.Height = e.ClipRectangle.Height;
source.X = dest.X / zoom;
source.Y = dest.Y / zoom;
source.Width = dest.Width / zoom;
source.Height = dest.Height / zoom;
e.Graphics.InterpolationMode =
InterpolationMode.NearestNeighbor;
e.Graphics.PixelOffsetMode =
PixelOffsetMode.HighQuality;
e.Graphics.DrawImage(image, dest, source,
GraphicsUnit.Pixel);
}
if(deleg != null)
deleg(this, e);
base.OnPaint(e);
}

Basically, what I'm looking for is something like a simple pixel resize. I've tried doing this manually, but with bigger images it takes a lot of resources. Any ideas?
GeneralRe: help in windows service Pin
Colin Angus Mackay18-Sep-04 15:25
Colin Angus Mackay18-Sep-04 15:25 
GeneralRe: help in windows service Pin
jacal9919-Sep-04 3:59
jacal9919-Sep-04 3:59 
GeneralRe: help in windows service Pin
Colin Angus Mackay19-Sep-04 4:08
Colin Angus Mackay19-Sep-04 4:08 
Generalmake setup Pin
fatidarya18-Sep-04 11:17
fatidarya18-Sep-04 11:17 
GeneralRe: make setup Pin
sreejith ss nair19-Sep-04 3:18
sreejith ss nair19-Sep-04 3:18 
GeneralMDIChild to MDIParent Pin
Finn Grimwood18-Sep-04 11:02
Finn Grimwood18-Sep-04 11:02 
GeneralRe: MDIChild to MDIParent Pin
Colin Angus Mackay18-Sep-04 15:38
Colin Angus Mackay18-Sep-04 15:38 
GeneralRe: MDIChild to MDIParent Pin
Finn Grimwood18-Sep-04 22:18
Finn Grimwood18-Sep-04 22:18 
Generallooking for a Component Pin
parnian honarmand18-Sep-04 10:08
parnian honarmand18-Sep-04 10:08 
GeneralRe: looking for a Component Pin
Alex Korchemniy19-Sep-04 12:23
Alex Korchemniy19-Sep-04 12:23 
Questionhowto read infos from *.url files ? Pin
Member 80267718-Sep-04 8:54
Member 80267718-Sep-04 8:54 
AnswerRe: howto read infos from *.url files ? Pin
Colin Angus Mackay18-Sep-04 15:51
Colin Angus Mackay18-Sep-04 15:51 
GeneralRe: howto read infos from *.url files ? Pin
Member 80267719-Sep-04 1:14
Member 80267719-Sep-04 1:14 
GeneralCopying richtext to Word Pin
RomanD18-Sep-04 8:29
RomanD18-Sep-04 8:29 
GeneralRe: Copying richtext to Word Pin
mav.northwind18-Sep-04 23:57
mav.northwind18-Sep-04 23:57 
QuestionWhich Pixel Was Clicked? Pin
Finn Grimwood18-Sep-04 8:10
Finn Grimwood18-Sep-04 8:10 
AnswerRe: Which Pixel Was Clicked? Pin
Charlie Williams18-Sep-04 9:20
Charlie Williams18-Sep-04 9:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.