Search Results

Search found 2 results on 1 pages for 'dgh'.

Page 1/1 | 1 

  • (C#) iterate over read-only private collection member

    - by DGH
    I have a class which has two HashSet collections as private members. Other classes in my code would like to be able to iterate over those HashSets and read their contents. I don't want to write a standard getter because another class could still do something like myClass.getHashSet().Clear(); Is there any other way to expose the elements of my HashSets to iteration without exposing the reference to the HashSet itself? I'd love to be able to do this in a way that is compatible with for-each loops.

    Read the article

  • (C#) graphics.drawImage has a size limit? How to deal with it?

    - by DGH
    I am attempting to display a very large graphical representation of some data. I am using a bitmap for persistent storage of the image and e.Graphics.DrawImage(myBitmap, new Point(0,0)) in the onPaint of a PictureBox control on my form. I have noticed (and heard mentioned on other sites) that if my image has a height or width greater than 2^15, I get a Parameter not Valid exception, but I have not found any official documentation of this limit. Is this 2^15 image size limit a definite, official part of Graphics.DrawImage? Are there any simple workarounds to render my entire image onto the form? (Yes, the pictureBox is set to the same size as the image, or bigger. Side question though, should I just be using the onPaint of the form itself instead of a picture box?)

    Read the article

1