0

I'm just looking for an equivalent or a method in c#

I have this class defined in delphi

TGraphicField

I wonder if there's something I could use in c# who would do the same or I have to create my own class.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
Mokmeuh
  • 865
  • 3
  • 11
  • 25
  • For people who know C# but not Delphi, it might help if you [edit] your question and explain what it is you're trying to do and what database you're using. Most people using C# are not necessarily familiar with what a `TGraphicField` is, and it's hard to suggest a replacement for it if you don't. – Ken White Jun 21 '13 at 18:30
  • I don't know delphi and I'm at a absic level of c#, ultimatly I don't know what a `TGraphicField` do even after readed freepascal website so I came here – Mokmeuh Jun 21 '13 at 18:32

1 Answers1

3

The purpose of TGraphicField is to store images within a database.

There isn't a single way to handle this in C#. Basically, in C#, you'd just use a BLOB column in the database, and serialize to and from an image yourself. This is most commonly handled via the MemoryStream class, which provides routines for treating a byte[] as a Stream, as well as saving into the MemoryStream then using ToArray() to convert back into a byte[].

Community
  • 1
  • 1
Reed Copsey
  • 554,122
  • 78
  • 1,158
  • 1,373