示例#1
0
        public Pen(Color_ color, float width)
        {
            Status status = GDIPlus.GdipCreatePen1(color.ToArgb(), width, GraphicsUnit.World, out nativeObject);

            GDIPlus.CheckStatus(status);
            this.color = color;
        }
示例#2
0
        public void SetPixel(int x, int y, Color_ color)
        {
            Status s = GDIPlus.GdipBitmapSetPixel(nativeObject, x, y, color.ToArgb());

            if (s == Status.InvalidParameter)
            {
                // check is done in case of an error only to avoid another
                // unmanaged call for normal (successful) calls
                if ((this.PixelFormat & PixelFormat.Indexed) != 0)
                {
                    string msg = Locale.GetText("SetPixel cannot be called on indexed bitmaps.");
                    throw new InvalidOperationException(msg);
                }
            }
            GDIPlus.CheckStatus(s);
        }
示例#3
0
        public IntPtr GetHbitmap(Color_ background)
        {
            IntPtr HandleBmp;

            Status status = GDIPlus.GdipCreateHBITMAPFromBitmap(nativeObject, out HandleBmp, background.ToArgb());

            GDIPlus.CheckStatus(status);

            return(HandleBmp);
        }