Click here to Skip to main content
15,899,475 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionPlay .pps / .ppt file without installing MS Office Powerpoint Pin
divyesh143215-Jul-08 18:09
divyesh143215-Jul-08 18:09 
QuestionRe: Play .pps / .ppt file without installing MS Office Powerpoint Pin
Paul Conrad16-Jul-08 4:39
professionalPaul Conrad16-Jul-08 4:39 
AnswerRe: Play .pps / .ppt file without installing MS Office Powerpoint Pin
Thomas Stockwell16-Jul-08 4:48
professionalThomas Stockwell16-Jul-08 4:48 
GeneralRe: Play .pps / .ppt file without installing MS Office Powerpoint Pin
Paul Conrad16-Jul-08 4:50
professionalPaul Conrad16-Jul-08 4:50 
QuestionEfficiently resizing an image with a pixel resize Pin
jacobjordan15-Jul-08 10:59
jacobjordan15-Jul-08 10:59 
AnswerRe: Efficiently resizing an image with a pixel resize Pin
Luc Pattyn15-Jul-08 11:18
sitebuilderLuc Pattyn15-Jul-08 11:18 
GeneralRe: Efficiently resizing an image with a pixel resize [modified] Pin
jacobjordan15-Jul-08 12:37
jacobjordan15-Jul-08 12:37 
GeneralRe: Efficiently resizing an image with a pixel resize Pin
Luc Pattyn15-Jul-08 13:21
sitebuilderLuc Pattyn15-Jul-08 13:21 
Hi,

You did not specify how exactly it does not what you want.

Three ideas:

1)

I ran a little experiment, and it seems to work fine, with one proviso: the NearestNeighbour
does duplicate pixels, but due to the nearest (not the left) source pixel, it will not duplicate
the leftmost/topmost pixel a sufficient number of times.

So to be exact, you should proceed as follows (I'll explain in one dimension):

input width w1, output width wanted w2, scalefactor f=w2/w1 (use reals for scale!)

split the output in three regions, with widths wa,wb,wc
wa=f/2 <--- represents half an input pixel
wb=(w1-1)*f
wc=w2-wa-wb <--- represents half an input pixel

now duplicate the leftmost pixel of input to wa,
duplicate the rightmost pixel of input to wc,
finally do the DrawImage scale with nearestneighbour from w1 to wb (i.e. shifted by wa)

That should put every single pixel at the right spot.


2)

I am pretty sure the complex copying of the edges could be handled by DrawImage itself,
provided you give it appropriate parameters.


3)

As an approximation you could do a two step approach:
- do DrawImage with Normal InterpolationMode for the full size;
- do DrawImage with NearestNeighbour InterpolationMode for a size that is half a pixel smaller
on all four edges of the output image (don't modify the input sizes!)

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Voting for dummies? No thanks. Dead | X|


GeneralRe: Efficiently resizing an image with a pixel resize Pin
jacobjordan15-Jul-08 13:25
jacobjordan15-Jul-08 13:25 
GeneralRe: Efficiently resizing an image with a pixel resize Pin
Luc Pattyn15-Jul-08 13:50
sitebuilderLuc Pattyn15-Jul-08 13:50 
GeneralRe: OnPaint Pin
Luc Pattyn15-Jul-08 15:05
sitebuilderLuc Pattyn15-Jul-08 15:05 
GeneralRe: Efficiently resizing an image with a pixel resize Pin
Luc Pattyn15-Jul-08 17:32
sitebuilderLuc Pattyn15-Jul-08 17:32 
Questiontreeview problem Pin
Member 226047315-Jul-08 10:31
Member 226047315-Jul-08 10:31 
AnswerRe: treeview problem Pin
Mr.PoorEnglish15-Jul-08 11:01
Mr.PoorEnglish15-Jul-08 11:01 
GeneralRe: treeview problem Pin
Member 226047315-Jul-08 16:13
Member 226047315-Jul-08 16:13 
GeneralRe: treeview problem Pin
Zaegra15-Jul-08 21:55
Zaegra15-Jul-08 21:55 
GeneralRe: treeview problem Pin
Mr.PoorEnglish15-Jul-08 22:51
Mr.PoorEnglish15-Jul-08 22:51 
QuestionIs there a way to get datagridview columns names in intellisense? Pin
Jon_Boy15-Jul-08 5:30
Jon_Boy15-Jul-08 5:30 
AnswerRe: Is there a way to get datagridview columns names in intellisense? Pin
Kschuler15-Jul-08 10:17
Kschuler15-Jul-08 10:17 
GeneralRe: Is there a way to get datagridview columns names in intellisense? Pin
Jon_Boy16-Jul-08 1:53
Jon_Boy16-Jul-08 1:53 
Questionresize problem in listbox Pin
emailthiaga15-Jul-08 3:01
emailthiaga15-Jul-08 3:01 
AnswerRe: resize problem in listbox Pin
John_Adams15-Jul-08 3:16
John_Adams15-Jul-08 3:16 
GeneralRe: resize problem in listbox Pin
emailthiaga15-Jul-08 3:42
emailthiaga15-Jul-08 3:42 
RantRe: resize problem in listbox Pin
Smithers-Jones15-Jul-08 22:08
Smithers-Jones15-Jul-08 22:08 
QuestionBackup & Restore SQL Server database Pin
Rupsaa15-Jul-08 0:30
Rupsaa15-Jul-08 0:30 

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.