- Home /
I use c# and have a problem about namespace System.Drawing!
using System.Drawing;
I edit references and add System.Drawing in it!
Monodevelop have no problem!
But why unity3d have error:
Assets/showpicture.cs(6,14): error CS0234: The type or namespace name
Drawing' does not exist in the > namespace
System'. Are you missing an assembly reference?I have System.Drawing in the project's references !Why? Do unity3d not support this namespace ? And how to make a stream with picture to a texture by unity3d?
Answer by sven1994 · Sep 28, 2011 at 08:22 PM
System.Drawing is not supported. As far as I know you can only use Texture/Texture2D classes.
But you can initialize a Texture and SetPixel onto it.
Answer by AltSoftLab · Jun 16, 2015 at 05:43 AM
Hi there!
You can use AltSketch Graphics Library that has System.Drawing like program interface and fully C# managed code (Mono, Mobile platforms supported too).
AltSketch project forum thread here: http://forum.unity3d.com/threads/altgui-altsketch-just-draw-it-new-powerful-features-for-the-unity-ui-ugui-ngui.333165
AltSketch Description:
AltSketch is a pure C# CLS compliant 100% managed, without unsafe blocks Vector Graphics Library with Software and Hardware Render Backends for Games, Scientific Applications & other uses of Computer Graphics. All core functionality collected in one lightweight library AltSketch.dll for Microsoft .NET Framework or Mono (including Silverlight / Moonlight). It depends only on System assembly (.NET Framework 2.0).
AltSketch has Software and Hardware Render Backends (solid and texure AA visual data triangulation), contains a subsystem AltNETType - port of wonderful font rendering library Freetype and subsystem AltNETImage for Image manipulations (loading, saving, transformations).
As AltSketch has several integrations with most popular GUI systems and Mobile platforms, you can develop and test a drawing part of your 3D application/game as independent program, and then easy integrate it into your main solution. Now you can draw Graphics in 3D with Brushes and Pens like you do it with any drawing library. It is flexible and useful development method in case of main project bulking and test complexity, or useful for team development process. Now you can develop graphics part of your Mobile applications without using an emulator as stand-alone application, only running on Mobile devices (or Emulator) for final tests.
AltSketch has Virtual File System support with Zip containers for resources loading. All AltSketch functionality & extensions works via VirtualFS and all resources can be loaded as from real file system, so from Zip containers (from files or memory streams).
AltSketch SDK includes wide variety of open source extensions: ported to AltSketch popular libraries (GUI, Plot, GIS, Computer Science, Physics, Graphics etc.): AForge, NPlot, OxyPlot, PieChart, ZedGraph, MigraDoc, PDFsharp, GMap, HTML Renderer, Box2D, Farseer Physics, etc.
AltSketch SDK includes many Integration Demos with a wide variety GUI-s & frameworks (all Integrations & HW Render Backends are open sourced, so you can easily adapt it to your applications or improve it if you need)