473,792 Members | 3,005 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to define a property as an Image data type?

I have a data model that has dozens of properties of most every data type. I
now want to declare a few of these properties as Images but can't seem to do
it.

The approach I thought would work was this one:

private Image _picture;
public Image Picture
{
get
{
return _picture;
}
set
{
_picture = value;
}
}

where I've declared "using System.Drawing" at the top of the file. But it
won't accept it. In fact, Intellisense doesn't even recognize
"System.Drawing ".

Is it not possible to declare a property as an Image type?

----------------------
Robert W.
Vancouver, BC
www.mwtech.com

Nov 17 '05 #1
4 22137
It is, but you need to reference the System.Drawing assembly in your
project. By default DLL project don't reference this. Just right-click on
your project in the IDE, and select Add References, choose System.Drawing
from the list in the first tab, and away you go.

"Robert W." <Ro*****@discus sions.microsoft .com> wrote in message
news:60******** *************** ***********@mic rosoft.com...
I have a data model that has dozens of properties of most every data type.
I
now want to declare a few of these properties as Images but can't seem to
do
it.

The approach I thought would work was this one:

private Image _picture;
public Image Picture
{
get
{
return _picture;
}
set
{
_picture = value;
}
}

where I've declared "using System.Drawing" at the top of the file. But it
won't accept it. In fact, Intellisense doesn't even recognize
"System.Drawing ".

Is it not possible to declare a property as an Image type?

----------------------
Robert W.
Vancouver, BC
www.mwtech.com

Nov 17 '05 #2
Sean,

Unbelievable, thank you! I would have never known to do this. Why
Microsoft couldn't have included some "smarts" into the Visual Studio UI to
account for it is beyond me.

If I'm ever on "Who Wants To Be A Millionaire" and there's a dotNet question
I don't know, I hope I can use you as my lifeline!!!

Thanks again,

Robert


"Sean Hederman" wrote:
It is, but you need to reference the System.Drawing assembly in your
project. By default DLL project don't reference this. Just right-click on
your project in the IDE, and select Add References, choose System.Drawing
from the list in the first tab, and away you go.

"Robert W." <Ro*****@discus sions.microsoft .com> wrote in message
news:60******** *************** ***********@mic rosoft.com...
I have a data model that has dozens of properties of most every data type.
I
now want to declare a few of these properties as Images but can't seem to
do
it.

The approach I thought would work was this one:

private Image _picture;
public Image Picture
{
get
{
return _picture;
}
set
{
_picture = value;
}
}

where I've declared "using System.Drawing" at the top of the file. But it
won't accept it. In fact, Intellisense doesn't even recognize
"System.Drawing ".

Is it not possible to declare a property as an Image type?

----------------------
Robert W.
Vancouver, BC
www.mwtech.com


Nov 17 '05 #3
Robert W. <Ro*****@discus sions.microsoft .com> wrote:
Unbelievable, thank you! I would have never known to do this. Why
Microsoft couldn't have included some "smarts" into the Visual Studio UI to
account for it is beyond me.


Well, to be fair to them, the error message you should have received is
pretty clear:

"The type or namespace name 'Drawing' does not exist in the class or
namespace 'System' (are you missing an assembly reference?)"

It says what the problem is *and* a possible cause.

Note that a namespace may be contributed to by several assemblies, and
you may also want to use an assembly that VS.NET doesn't know about. I
agree that VS.NET could be better here, but I don't think it's being
particularly bad.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #4
"Jon Skeet [C# MVP]" <sk***@pobox.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
Robert W. <Ro*****@discus sions.microsoft .com> wrote:
Unbelievable, thank you! I would have never known to do this. Why
Microsoft couldn't have included some "smarts" into the Visual Studio UI
to
account for it is beyond me.


Well, to be fair to them, the error message you should have received is
pretty clear:


I didn't want to say anything, he said such nice things about me :-)
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
13310
by: prasaddevivara | last post by:
I am using the outerHTML property to modify the HTML of existin elements in a web page in Internet Explorer. But same outerHTM property is not working in firefox browser, Anybody can tell me a alternative for outerHTML property in firefox. I am using th following function to display an image and alternate text behind al images of a weg page in Internet Explorer. Anybody can give solutio for same in firefox browser. function...
12
5805
by: Pol Bawin | last post by:
Hi All, Did somebody already define attributes for numerical properties to define value : minima, maxima, a number of decimal, ...? This information would be useful to unify syntax Polo
0
4453
by: MS Newsgroups | last post by:
Hi, I am trying to store a thumbnail picture in ActiveDirectory, but am having some problems with type conversions. According to the documentation the Thumbnailphoto property in the directory is of typ OctetString, and i belive i read somewhere that i can use the convert.ToBase64string function to convert a byte array to a octetstring. This seem to be working since i can insert a image with the code:
6
3591
by: Kay | last post by:
Hi all, In vb6, I can define a custom type like this: Private Type uClient sName As String sMonday As Double sMondayHeadCnt As Integer End Type
1
1223
by: --== Alain ==-- | last post by:
Hi, I've seen that on all component it is possible to have (none) as value for a property. Usually i see it for Image or ImageList property type. So tried it on my component. I can set the image without problem, but i can not clear the property if i do not want to use it... to clean the property, i mean by that, to not allocate an image data to it... so it should display (none) as value.
0
995
by: --== Alain ==-- | last post by:
Hi, I've seen that on all component it is possible to have (none) as value for a property. Usually i see it for Image or ImageList property type. So tried it on my component. I can set the image without problem, but i can not clear the property if i do not want to use it... to clean the property, i mean by that, to not allocate an image data to it... so it should display (none) as value.
0
1439
by: doubts | last post by:
Hi, I have a query regarding reading Image Property for button from a XML file . I read XML files to Generate Screens using System.Windows.Forms.Controls .The XML file is read and properties are set using Reflection a sample representation of it is given below
1
413
by: doubts | last post by:
Hi, I have a query regarding reading Image Property for button from a XML file . I read XML files to Generate Screens using System.Windows.Forms.Controls .The XML file is read and properties are set using Reflection
7
1890
by: Computer Guru | last post by:
Hi, Pardon the unclear/verbose subject, I just can't think of another way of phrasing it. Basically, I can assign the (for instance) "Location" property of a picture box to a data-bound item. Like, I can get the absoloute location from an ADO.NET database, and assign it to the PictureBox.Location property.
0
9518
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10430
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10211
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.