473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Interface designing and Implementation

2 Bit
Hi Friends,

Below is the question I encountered and still figuring out how to implement it. Can someone help.

Implement the IIMage interface. This interface defines an image, defined as a rectangle of some width and height
where each pixel has a color which can be set and retrieved.

· Implement Image interface to draw an image with specific height and width.
· Each pixel can be set different color.
· User “C# Indexer” to complete the above problem.


public interface IIMage
{
IColor this[int x, int y] [get;set;}
}

public interface IColor
{

}


public class MyIMage : IIMage
{

public MyImage (int width, int height, IColor efaultColor)
{
}

public IColor this[int x, int y]
{ get => throw new NotImplementedException();
set => throw new NotImplementedException();
}
}
Aug 21 '21 #1
0 2829

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Paul Fame | last post by:
Hello World, This is not a flame, but a question about the fundamentals of the language. Unlike some languages, C++ requires class member functions to be declared twice: once in the class...
9
by: Anon Email | last post by:
Hi people, I'm learning about header files in C++. The following is code from Bartosz Milewski: // Code const int maxStack = 16; class IStack
175
by: Ken Brady | last post by:
I'm on a team building some class libraries to be used by many other projects. Some members of our team insist that "All public methods should be virtual" just in case "anything needs to be...
2
by: jack | last post by:
Hi all, im in a middle of an project and it is going pretty well. But one this that is always in back of my mind is the interface design. every day i look at it i tend to change either the...
3
by: rubycon | last post by:
Hello all, I get the following errormessage when trying to compile this class, can somebody tell me what's wrong? The errormessage: GraphicObjects.cs(203):...
20
by: Andy DeMaurice | last post by:
Something has changed from C# 1.0 to 2.0 regarding interface re-implementation. See my sample code below; when compiled and run under VS 2003, you get: Control.Paint Control.IControl.Paint ...
0
by: Ken | last post by:
Hi I have a little application that does datavalidation. It supports dynamically loaded plugins (you drop a dll with a class implementing IValidator<Tin the same dir as the main application)....
1
by: recherche | last post by:
Hola! I tried the following public implementation of interface indexer by struct (Code Snippet 1) in private and explicit implementation by struct (Code Snippet 2) but in vain. Please help! ...
4
by: innes | last post by:
Hi, I'm unable to work out the syntax for explicit implementation of an interface property. Example Code: ----- public interface class ITest { int M();
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.