コード例 #1
0
ファイル: MSPS2.cs プロジェクト: sayaPintar/PurpleMoonOS_Old
        public static void Update()
        {
            // previous state
            if (stateOld != state)
            {
                stateOld = state;
            }

            // get cursor type
            uint[] cursorData = Cursors.arrow;
            if (cursor == Cursor.arrow)
            {
                cursorData = Cursors.arrow;
            }

            if (position.x != positionOld.x && position.y != positionOld.y)
            {
                moving = true;
            }
            else
            {
                moving = false;
            }

            positionOld.x = position.x;
            positionOld.y = position.y;

            // draw cursor
            Graphics2D.DrawBitmap(new Rectangle(x, y, 12, 20), cursorData, Color.magenta, true);
        }
コード例 #2
0
ファイル: Shell.cs プロジェクト: sayaPintar/PurpleMoonOS_Old
        public override void Draw()
        {
            // update/draw controls
            ctrlMgr.Update();

            // draw menu btn icon
            Graphics2D.DrawBitmap(new Rectangle(4, 4, 14, 14), Bitmap.MENU_ICON, Color.magenta, true);
        }
コード例 #3
0
        public override void Draw()
        {
            // update/draw controls
            ctrlMgr.Update();

            // draw menu btn icon
            Graphics2D.DrawBitmap(new Rectangle(4, 4, 14, 14), Bitmap.MENU_ICON, Color.magenta, true);
            Graphics2D.DrawStringShadow(24, 6, "PurpleMoon OS", Color.white, Color.black, 1, Fonts.FONT_MONO_BIG);
        }
コード例 #4
0
        public override void Draw()
        {
            if (state != WindowState.minimized)
            {
                DrawWindow();

                // draw icon
                Graphics2D.DrawBitmap(new Rectangle(x + 4, y + 26, 32, 32), Bitmap.LOGO_32, Color.magenta, true);

                // draw title
                Graphics2D.DrawStringShadow(x + 40, y + 39, Kernel.OS_NAME, Color.white, Color.black, 1, Fonts.FONT_MONO_BIG);

                // draw version
                Graphics2D.DrawStringShadow(x + 4, y + 62, "Alpha " + Kernel.OS_VER, Color.silver, Color.black, 1, Fonts.FONT_MONO);

                // draw kernel version
                Graphics2D.DrawStringShadow(x + 4, y + 74, "Kernel: " + Kernel.KERNEL_VER, Color.silver, Color.black, 1, Fonts.FONT_MONO);

                // draw info
                Graphics2D.DrawStringShadow(x + 4, y + 90, Kernel.KERNEL_INFO, Color.white, Color.black, 1, Fonts.FONT_MONO);

                btnExit.Draw();
            }
        }
コード例 #5
0
            /// <summary>
            /// Called when we've to draw the image.
            /// </summary>
            /// <param name="graphics">The graphics.</param>
            private void OnDraw(Graphics2D graphics)
            {
                if (IsDisposed) { throw new ObjectDisposedException("ImageDataFlowHelper"); }

                if (this.SyncBuffer == null) { return; }

                // Change bitmap contents if needed
                if (this.SyncBufferChanged)
                {
                    lock (this.SyncBufferLock)
                    {
                        // Recreate bitmap on need
                        if ((this.BitmapSize != this.SyncBufferSize) ||
                           (this.Bitmap == null))
                        {
                            CommonTools.SafeDispose(ref this.Bitmap);
                            this.Bitmap = new WriteableBitmapResource(
                                new Size2(this.SyncBufferSize.Width, this.SyncBufferSize.Height),
                                BitmapFormat.Bgra, AlphaMode.Ignore);
                            this.BitmapSize = this.SyncBufferSize;
                        }

                        // Write data from SyncBuffer to bitmap
                        this.Bitmap.SetBitmapContent(
                            graphics,
                            this.SyncBuffer.Pointer,
                            this.SyncBuffer.Pitch);
                    }
                }

                // Draw the bitmap on the screen
                if ((this.Bitmap != null) &&
                    (this.BitmapSize.Width > 0) &&
                    (this.BitmapSize.Height > 0))
                {
                    graphics.Clear(Color4.Transparent);

                    // Draw the current contents of the stream
                    RectangleF viewBounds = new RectangleF(
                        0f, 0f,
                        graphics.ScreenSize.Width, graphics.ScreenSize.Height);
                    graphics.DrawBitmap(this.Bitmap, viewBounds);

                    // Draw the stream's name
                    RectangleF titleBounds = new RectangleF(
                        viewBounds.Width / 2f - 100f,
                        10f,
                        200f, 30f);
                    graphics.FillRoundedRectangle(titleBounds, 5f, 5f, this.TextBackground);
                    graphics.DrawText(
                        this.StreamName, this.TextFormat,
                        titleBounds,
                        this.TextForeground);
                }
            }