Click here to Skip to main content
15,891,744 members
Home / Discussions / C#
   

C#

 
GeneralRe: ThreadPool misbehaving Pin
TheFLC26-Aug-03 7:13
TheFLC26-Aug-03 7:13 
QuestionHTML in C# ?? Pin
yyf26-Aug-03 3:13
yyf26-Aug-03 3:13 
GeneralEmail attachment on Outlook express Pin
Velichko Sarev26-Aug-03 3:02
Velichko Sarev26-Aug-03 3:02 
GeneralSilly bug in Left-to-Right Menu Pin
Hovik Melkomian26-Aug-03 2:29
Hovik Melkomian26-Aug-03 2:29 
GeneralHolding ArrayLists in an ArrayList Pin
amadeonMk25-Aug-03 22:45
amadeonMk25-Aug-03 22:45 
GeneralRe: Holding ArrayLists in an ArrayList Pin
A.Wegierski25-Aug-03 22:55
A.Wegierski25-Aug-03 22:55 
GeneralRe: Holding ArrayLists in an ArrayList Pin
amadeonMk26-Aug-03 0:43
amadeonMk26-Aug-03 0:43 
GeneralRe: Holding ArrayLists in an ArrayList Pin
Julian Bucknall [MSFT]26-Aug-03 5:50
Julian Bucknall [MSFT]26-Aug-03 5:50 
GeneralRe: Holding ArrayLists in an ArrayList Pin
A.Wegierski26-Aug-03 20:12
A.Wegierski26-Aug-03 20:12 
Question.NET security sample anyone? Pin
devvvy25-Aug-03 21:36
devvvy25-Aug-03 21:36 
GeneralI cann't send mail to the other server Pin
Velichko Sarev25-Aug-03 20:54
Velichko Sarev25-Aug-03 20:54 
GeneralRe: I cann't send mail to the other server Pin
Corinna John28-Aug-03 1:28
Corinna John28-Aug-03 1:28 
GeneralFast graphics in C# Pin
Stephane David25-Aug-03 20:37
Stephane David25-Aug-03 20:37 
GeneralRe: Fast graphics in C# Pin
Meysam Mahfouzi25-Aug-03 23:35
Meysam Mahfouzi25-Aug-03 23:35 
GeneralRe: Fast graphics in C# Pin
Stephane David26-Aug-03 1:26
Stephane David26-Aug-03 1:26 
GeneralRe: Fast graphics in C# Pin
Ista26-Aug-03 4:46
Ista26-Aug-03 4:46 
GeneralRe: Fast graphics in C# Pin
Philip Fitzsimons26-Aug-03 2:28
Philip Fitzsimons26-Aug-03 2:28 
GeneralRe: Fast graphics in C# Pin
Stephane David26-Aug-03 3:55
Stephane David26-Aug-03 3:55 
GeneralRe: Fast graphics in C# Pin
Philip Fitzsimons26-Aug-03 4:25
Philip Fitzsimons26-Aug-03 4:25 
GeneralRe: Fast graphics in C# Pin
Philip Fitzsimons26-Aug-03 4:43
Philip Fitzsimons26-Aug-03 4:43 
GeneralRe: Fast graphics in C# Pin
Stephane David26-Aug-03 5:06
Stephane David26-Aug-03 5:06 
GeneralRe: Fast graphics in C# Pin
Philip Fitzsimons26-Aug-03 5:46
Philip Fitzsimons26-Aug-03 5:46 
GeneralRe: Fast graphics in C# Pin
Stephane David26-Aug-03 11:04
Stephane David26-Aug-03 11:04 
Before I did this

graphics.DrawImage(backgroundSprite.Canvas.PictureFile,destinationRectangle,backgroundSprite.SourceRect,GraphicsUnit.Pixel);

and I had in memory one file with 9x9 tiles. I selected the tile from the source rectangle, and copied it in my PictureBox.

Now I have that :

graphics.DrawImage(backgroundCanvasArray[BackgroundCanvas].TilesArray[line,column],offsetX,offsetY);

and I have an array of tile 9x9.

Initialization is a bit longer, as I have to break my 9x9 tiles images into 81 images in an array.

But then, for the rendering I simply draw the tiles directly at the offset, without specifying a source and destination rectangle.

Result : rendering time for a 20x20 tiles world has dropped from 950 ms to 30 ms.

What took time was the resampling of the image to fit the new size, EVEN IF IT WAS THE SAME SIZE.

Now it works well enough
GeneralRe: Fast graphics in C# Pin
Philip Fitzsimons26-Aug-03 23:11
Philip Fitzsimons26-Aug-03 23:11 
GeneralRe: Fast graphics in C# Pin
Ista26-Aug-03 4:45
Ista26-Aug-03 4:45 

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.