Imaging, Bitmap.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I'm making an application that needs to open -- and display -- large
images. The code I use to open images is:
comicPage = new Bitmap(pages[currentPage].ToString());

The problem is that these images (comic books) can be quite large, sometimes
up to 1900x* (dont remember the exact, but they are A4 sized), and since they
are so large they can take an annoyingly to load. Imagine reading a comic
book and having to wait 5-10 sec before you can watch the next page -- no
good.

My question is; Are there other ways to do this faster? To scroll downwards
without lag I resize the image to a smaller format, but is there a way to do
this "right away", or is there no way around the load-time?
 
Well, like I said the images are quite large, and as such are resized to a
smaller version (the width of the image = the width of the screen and the
height is adjusted appropriately.) this enables me to not only view the
comicpage in a readable format (I have a VGA pda) but it also let's me scroll
downwards without any "lagging".

I'm not sure how you mean I can show only a part of the image, when the
image that is loaded is not the image shown.
 
Lets assume you have "large.bmp", before put it into device split it on
several rectangles i.e. 240x320 then place on your form two ScrollBars,
one for X and one for Y, set its Max value to the whole size of image
(i.e. 1900x2400). When user click on scrollbar (X or Y) you should
detect which sectors you should display. E.g. user see the first (0..239
and 0..319) then when he will press X-Scrollbar you will detect that he
now see a part of another sector (320...639 and 0...319), load it to the
memory and start to display.

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com
 
Back
Top