Click here to Skip to main content
15,890,670 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Check the serial port event PinChanged Pin
feromontalvo24-May-10 23:07
feromontalvo24-May-10 23:07 
Questioncollection of different sections in app.config file Pin
dashingsidds20-May-10 0:43
dashingsidds20-May-10 0:43 
AnswerRe: collection of different sections in app.config file Pin
Richard MacCutchan20-May-10 2:12
mveRichard MacCutchan20-May-10 2:12 
GeneralRe: collection of different sections in app.config file Pin
dashingsidds20-May-10 19:57
dashingsidds20-May-10 19:57 
QuestionDataSet.AddTable order dependence? Pin
Marc Clifton19-May-10 10:28
mvaMarc Clifton19-May-10 10:28 
AnswerRe: DataSet.AddTable order dependence? Pin
Not Active19-May-10 13:02
mentorNot Active19-May-10 13:02 
QuestionResize a monochrome bitmap without using any class Pin
Mehdi Ghiasi19-May-10 7:54
Mehdi Ghiasi19-May-10 7:54 
AnswerRe: Resize a monochrome bitmap without using any class Pin
Luc Pattyn19-May-10 14:55
sitebuilderLuc Pattyn19-May-10 14:55 
You can't run anything under .NET without using some .NET classes, so I'll assume the classes you want to avoid are the graphical ones only. Then this is the recipe:

1. study the specification of your input image format, maybe it is a BMP file;
2. read the input, probably into a byte array;
3. now turn it into some in-memory representation that you feel comfortable with;
4. perform the resize, i.e. create a new bitmap in memory
5. study the specification of your output image format, maybe it is a PNG file;
6. generate your output image by converting it into the output format.


You probably could combine some of the steps. You will need a lot of bit manipulations, so make sure you are fluent in masking, shifting, and the like. For the resizing itself, you may choose a nearest-neighbor approach, or alternatively you may want to study different interpolation algorithms, bi-cubic is popular.

If you need an extra challenge, you may implement compression, e.g. the one used in the JPEG file format.

The alternative to all of the above is less than 10 lines of code, based on the Bitmap class.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

QuestionRe: Resize a monochrome bitmap without using any class Pin
Mehdi Ghiasi20-May-10 2:06
Mehdi Ghiasi20-May-10 2:06 
AnswerRe: Resize a monochrome bitmap without using any class Pin
Luc Pattyn20-May-10 2:19
sitebuilderLuc Pattyn20-May-10 2:19 
QuestionRe: Resize a monochrome bitmap without using any class Pin
Mehdi Ghiasi20-May-10 7:18
Mehdi Ghiasi20-May-10 7:18 
AnswerRe: Resize a monochrome bitmap without using any class Pin
Thomas Krojer21-May-10 4:08
Thomas Krojer21-May-10 4:08 
JokeRe: Resize a monochrome bitmap without using any class Pin
T M Gray21-May-10 5:24
T M Gray21-May-10 5:24 
QuestionAccepting a rejected character in a Masked Textbox Pin
gmhanna18-May-10 1:58
gmhanna18-May-10 1:58 
AnswerRe: Accepting a rejected character in a Masked Textbox Pin
Peace ON18-May-10 2:42
Peace ON18-May-10 2:42 
QuestionAdvanced .NET cource Pin
marca29217-May-10 19:56
marca29217-May-10 19:56 
AnswerRe: Advanced .NET cource Pin
Richard MacCutchan17-May-10 21:26
mveRichard MacCutchan17-May-10 21:26 
GeneralRe: Advanced .NET cource Pin
marca29217-May-10 22:18
marca29217-May-10 22:18 
GeneralRe: Advanced .NET cource Pin
Richard MacCutchan18-May-10 10:59
mveRichard MacCutchan18-May-10 10:59 
AnswerRe: Advanced .NET cource Pin
Luc Pattyn18-May-10 1:19
sitebuilderLuc Pattyn18-May-10 1:19 
QuestionRender Method Pin
Mountainking0217-May-10 8:37
Mountainking0217-May-10 8:37 
AnswerRe: Render Method Pin
Luc Pattyn17-May-10 8:58
sitebuilderLuc Pattyn17-May-10 8:58 
QuestionRe: Render Method Pin
Mountainking0220-May-10 4:48
Mountainking0220-May-10 4:48 
AnswerRe: Render Method Pin
Luc Pattyn20-May-10 5:14
sitebuilderLuc Pattyn20-May-10 5:14 
QuestionRe: Render Method Pin
Mountainking0220-May-10 5:48
Mountainking0220-May-10 5:48 

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.