Click here to Skip to main content
15,900,906 members
Home / Discussions / C#
   

C#

 
AnswerRe: List suggestions for my needs Pin
PIEBALDconsult29-Apr-10 8:23
mvePIEBALDconsult29-Apr-10 8:23 
GeneralRe: List suggestions for my needs Pin
grmihel23-May-10 4:24
grmihel23-May-10 4:24 
GeneralRe: List suggestions for my needs Pin
PIEBALDconsult3-May-10 5:19
mvePIEBALDconsult3-May-10 5:19 
GeneralRe: List suggestions for my needs Pin
grmihel24-May-10 0:13
grmihel24-May-10 0:13 
QuestionMulti-Page TIFF support Pin
Jordy "Kaiwa" Ruiter28-Apr-10 23:27
Jordy "Kaiwa" Ruiter28-Apr-10 23:27 
AnswerRe: Multi-Page TIFF support Pin
Luc Pattyn29-Apr-10 0:59
sitebuilderLuc Pattyn29-Apr-10 0:59 
QuestionRe: Multi-Page TIFF support [modified] Pin
Jordy "Kaiwa" Ruiter29-Apr-10 1:11
Jordy "Kaiwa" Ruiter29-Apr-10 1:11 
GeneralRe: Multi-Page TIFF support [modified] Pin
Luc Pattyn29-Apr-10 1:36
sitebuilderLuc Pattyn29-Apr-10 1:36 
Confused | :confused:


Jordy "Kaiwa" Ruiter wrote:
to store the original TIFF file next to the Bitmap it would mean that I need double the resource for the same image


I don't think so. You load the (multi-page) image once, and keep one (or more) references to it; and you need a bitmap that represents one page, that will cost you a fraction of the multi-page image.

You could encapsulate things in a little class (more error handling may be needed):

class MultiPageImage {
    private Image image;

    public Image Image {
        get {
            return image;
        }
        set {
            if (image!=null) image.Dispose;
            image=value;
        }
    }

    public Bitmap GetBitmap() {
        if (image==null) return null;
        return new Bitmap(image);
    }

    public Bitmap GetBitmap(int pageNumber) {
        if (image==null) return null;
        image.SelectActiveFrame(System.Drawing.Imaging.FrameDimension.Page, nextPage);
        return new Bitmap(image);
    }
}


Warning: if you don't actually copy the multi-page image, the current page setting is affecting both this class and the external image users. For perfect encapsulation, one would have to copy the image in the setter property.

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

Prolific encyclopedia fixture proof-reader browser patron addict?
We all depend on the beast below.


modified on Thursday, April 29, 2010 8:00 AM

GeneralRe: Multi-Page TIFF support Pin
Jordy "Kaiwa" Ruiter29-Apr-10 2:41
Jordy "Kaiwa" Ruiter29-Apr-10 2:41 
GeneralRe: Multi-Page TIFF support Pin
Luc Pattyn29-Apr-10 3:03
sitebuilderLuc Pattyn29-Apr-10 3:03 
GeneralRe: Multi-Page TIFF support Pin
Jordy "Kaiwa" Ruiter29-Apr-10 3:24
Jordy "Kaiwa" Ruiter29-Apr-10 3:24 
GeneralRe: Multi-Page TIFF support Pin
Luc Pattyn29-Apr-10 3:32
sitebuilderLuc Pattyn29-Apr-10 3:32 
GeneralRe: Multi-Page TIFF support Pin
Jordy "Kaiwa" Ruiter29-Apr-10 3:39
Jordy "Kaiwa" Ruiter29-Apr-10 3:39 
GeneralRe: Multi-Page TIFF support Pin
Luc Pattyn29-Apr-10 3:51
sitebuilderLuc Pattyn29-Apr-10 3:51 
QuestionIs it Possible to download a pdf file from a web page without showing the URL of pdf file in address bar Pin
Puneet Bhatnagar28-Apr-10 22:49
Puneet Bhatnagar28-Apr-10 22:49 
AnswerRe: Is it Possible to download a pdf file from a web page without showing the URL of pdf file in address bar Pin
Gaurav Dudeja India28-Apr-10 22:57
Gaurav Dudeja India28-Apr-10 22:57 
GeneralRe: Is it Possible to download a pdf file from a web page without showing the URL of pdf file in address bar Pin
Matt Meyer29-Apr-10 6:12
Matt Meyer29-Apr-10 6:12 
AnswerRe: Is it Possible to download a pdf file from a web page without showing the URL of pdf file in address bar [modified] Pin
Covean29-Apr-10 0:18
Covean29-Apr-10 0:18 
AnswerRe: Is it Possible to download a pdf file from a web page without showing the URL of pdf file in address bar Pin
AspDotNetDev29-Apr-10 10:42
protectorAspDotNetDev29-Apr-10 10:42 
GeneralRe: Is it Possible to download a pdf file from a web page without showing the URL of pdf file in address bar Pin
PunkIsNotDead29-Apr-10 17:18
PunkIsNotDead29-Apr-10 17:18 
GeneralRe: Is it Possible to download a pdf file from a web page without showing the URL of pdf file in address bar Pin
AspDotNetDev29-Apr-10 17:25
protectorAspDotNetDev29-Apr-10 17:25 
AnswerRe: Is it Possible to download a pdf file from a web page without showing the URL of pdf file in address bar Pin
PunkIsNotDead29-Apr-10 17:35
PunkIsNotDead29-Apr-10 17:35 
QuestionClearing an array of images Pin
Wamuti28-Apr-10 22:23
Wamuti28-Apr-10 22:23 
AnswerRe: Clearing an array of images Pin
Mycroft Holmes28-Apr-10 23:37
professionalMycroft Holmes28-Apr-10 23:37 
AnswerRe: Clearing an array of images Pin
Luc Pattyn29-Apr-10 1:07
sitebuilderLuc Pattyn29-Apr-10 1:07 

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.