Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class IMG256Colours {
- private int _width;
- private int _height;
- private Palette256Colours _palette;
- private byte [] _colours;
- /// <summary>
- /// Gets the image's width
- /// </summary>
- public int width {
- get {
- return _width;
- }
- }
- /// <summary>
- /// Gets the image's height
- /// </summary>
- public int height {
- get {
- return _height;
- }
- }
- /// <summary>
- /// Gets or sets the image's palette
- /// </summary>
- public Palette256Colours palette {
- get {
- return _palette;
- } set {
- _palette = value;
- }
- }
- public IMG256Colours (int newWidth, int newHeight, Palette256Colours newPalette) {
- _width = newWidth;
- _height = newHeight;
- _palette = newPalette;
- _colours = new byte [newWidth * newHeight];
- }
- ~IMG256Colours () {
- _width = 0;
- _height = 0;
- }
- public byte this [int index] {
- get {
- return _colours [index];
- } set {
- _colours [index] = value;
- }
- }
- public Bitmap ToBitmap () {
- Bitmap bitmap = new Bitmap (_width, _height);
- for (int i = 0; i < _width * _height; i++)
- bitmap.SetPixel (
- return bitmap;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement