Click here to Skip to main content
15,907,493 members
Home / Discussions / C#
   

C#

 
QuestionHow to make print job in a specific order using C# Pin
tiasoft26-Oct-07 0:26
tiasoft26-Oct-07 0:26 
AnswerRe: How to make print job in a specific order using C# Pin
Paul Conrad27-Oct-07 12:25
professionalPaul Conrad27-Oct-07 12:25 
QuestionThread & timer in Web application C# Pin
ASGuru26-Oct-07 0:18
ASGuru26-Oct-07 0:18 
AnswerRe: Thread & timer in Web application C# Pin
Christian Graus26-Oct-07 0:31
protectorChristian Graus26-Oct-07 0:31 
QuestionLoad and resize a bitmap Pin
Christian Graus26-Oct-07 0:17
protectorChristian Graus26-Oct-07 0:17 
AnswerRe: Load and resize a bitmap Pin
codemunkeh26-Oct-07 0:53
codemunkeh26-Oct-07 0:53 
GeneralRe: Load and resize a bitmap Pin
Christian Graus26-Oct-07 1:10
protectorChristian Graus26-Oct-07 1:10 
AnswerRe: Load and resize a bitmap [modified] Pin
Anthony Mushrow26-Oct-07 1:11
professionalAnthony Mushrow26-Oct-07 1:11 
The easiest way i can think of to resize an image, is to use graphics.drawimage

You'll have to calculate the ratio between the old size, and the new size. Then use the draw method to draw from 0,0,500,500 for example, into a new bitmap to the rectangle 0,0,250,250 That should resize the image. Then save this small portion in to a temp file somewhere. Then, move onto the next portion.

Once you've finished with the large image, you can get rid of it. Then, create a new bitmap of the desired size, and start opening up your temp files, and rebuild the full image.

Of course it would be quicker to sacrifice memory, and just copy the image directly. But if you have 32-bit images with huge sizes like 4092*4092, then it is gonna take up alot of space isn't it... infact almost 50MB

-- modified at 7:25 Friday 26th October, 2007

Okay, as for the original image, the problem is the header information, and the way the data is stored. For a regular bitmap, you could read the header information, find the size (width, height) and bit-depth of the image, then just start reading off the bytes because there's no compression.

As for something more like a png, it may be difficult to do because of the way the information is stored, and well, i havn't come up with much.

My current favourite word is: Waffle

Cheese is still good though.

GeneralRe: Load and resize a bitmap Pin
Christian Graus26-Oct-07 11:47
protectorChristian Graus26-Oct-07 11:47 
AnswerRe: Load and resize a bitmap Pin
Luc Pattyn26-Oct-07 3:25
sitebuilderLuc Pattyn26-Oct-07 3:25 
GeneralRe: Load and resize a bitmap Pin
Christian Graus26-Oct-07 11:53
protectorChristian Graus26-Oct-07 11:53 
GeneralRe: Load and resize a bitmap Pin
Luc Pattyn26-Oct-07 14:46
sitebuilderLuc Pattyn26-Oct-07 14:46 
Questionrouting Pin
tuananh230526-Oct-07 0:12
tuananh230526-Oct-07 0:12 
AnswerRe: routing Pin
Christian Graus26-Oct-07 0:18
protectorChristian Graus26-Oct-07 0:18 
Questionrouting Pin
tuananh230526-Oct-07 0:06
tuananh230526-Oct-07 0:06 
AnswerRe: routing Pin
il_masacratore26-Oct-07 3:08
il_masacratore26-Oct-07 3:08 
Questionfire an email after a checkboxlist item was unchecked Pin
alok217126-Oct-07 0:02
alok217126-Oct-07 0:02 
AnswerRe: fire an email after a checkboxlist item was unchecked Pin
codemunkeh26-Oct-07 0:44
codemunkeh26-Oct-07 0:44 
QuestionRun exe on client Machine Pin
Sun Rays25-Oct-07 23:37
Sun Rays25-Oct-07 23:37 
AnswerRe: Run exe on client Machine Pin
Christian Graus25-Oct-07 23:49
protectorChristian Graus25-Oct-07 23:49 
GeneralRe: Run exe on client Machine Pin
J4amieC26-Oct-07 1:12
J4amieC26-Oct-07 1:12 
GeneralRe: Run exe on client Machine Pin
Sun Rays27-Oct-07 0:41
Sun Rays27-Oct-07 0:41 
AnswerRe: Run exe on client Machine Pin
Guffa25-Oct-07 23:58
Guffa25-Oct-07 23:58 
AnswerRe: Run exe on client Machine Pin
darkelv26-Oct-07 1:17
darkelv26-Oct-07 1:17 
QuestionProblem Canceling BindingNavigator (AddItem) Event Pin
azifaliazif25-Oct-07 23:03
azifaliazif25-Oct-07 23:03 

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.