winforms - Images Scaling Down in draw in C# -


alright guys last little bit of project i'll ask on promise. go load images, works fine notice upon loading dimensions of image have been scaled down in y 300 (all constant value of 433) , or down original width 600. i'm using following method load them

foreach (string file in directory.enumeratefiles(imagepath, "*.jpg")) {     image contents = image.fromfile(file);     treesimage[count] = contents;     count++; } 

and resulting image when have loaded.

http://i.stack.imgur.com/q40kk.png

as can see image below red rectangle quite small

any appreciated. if require more information please post below , i'll make sure edit original question relevant information humanly possible.

edit: using simple windows form application , not graphical framework own reasons. in advance :)

i'll assume using picturebox control display image.

when chooses tree map, set picturebox image property image object referenced index in array. use image object set clientsize of picturebox control.

... image img = treesimage[idx]; mypicturebox.sizemode = pictureboxsizemode.normal; mypicturebox.clientsize = new size(img.width,img.height); mypicturebox.image = img; ... 

alternately can define 1 size picturebox , force images scaled size setting control sizemode property stretchimage declaratively.

i recommend create simple class (myimageinfo example) store path, width, , height of images found in first function list , before when user clicks view image set width , height of picturebox , call loadasync(path) method image. aren't storing images in memory @ once, need them since doesn't requires lot of quick jumping image image.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -