GAPI для VB.NET вроде как только к C++ подходит.
using System;
using System.Runtime.InteropServices;
namespace FastGraphics
{
internal static unsafe class GXLib
{
[Flags]
public enum DispFlags : int
{
Default = 0x0000,
Fullscreen = 0x0001,
NormalKeys = 0x0002,
LandscapeKeys = 0x0003,
Landscape = 0x0008,
}
[Flags]
public enum ColorFormat : uint
{
_null = 0,
Landscape = 0x0008,
Palette = 0x0010,
Direct = 0x0020,
Direct555 = 0x0040,
Direct565 = 0x0080,
Direct888 = 0x0100,
Direct444 = 0x0200,
DirectInverted = 0x0400,
}
[StructLayout(LayoutKind.Sequential)]
public struct DisplayProperties
{
public int cxWidth;
public int cyHeight; // notice lack of 'th' in the word height.
public int cbxPitch; // number of bytes to move right one x pixel - can be negative.
public int cbyPitch; // number of bytes to move down one y pixel - can be negative.
public int cBPP; // # of bits in each pixel
public ColorFormat ffFormat; // format flags.
}
[StructLayout(LayoutKind.Sequential)]
public struct KeyList
{
public short vkUp; // key for up
public Point ptUp; // x,y position of key/button. Not on screen but in screen coordinates.
public short vkDown;
public Point ptDown;
public short vkLeft;
public Point ptLeft;
public short vkRight;
public Point ptRight;
public short vkA;
public Point ptA;
public short vkB;
public Point ptB;
public short vkC;
public Point ptC;
public short vkStart;
public Point ptStart;
}
[DllImport("gapinet.dll", EntryPoint = "GXGetDisplayProperties")]
extern public static void GetDisplayProperties(ref DisplayProperties displayProps);
[DllImport("gapinet.dll", EntryPoint = "GXGetDefaultKeys")]
extern public static void GXGetDefaultKeys(ref KeyList keyList, int iOptions);
[DllImport("gx.dll", EntryPoint = "#6")]
public static extern DisplayProperties GetDisplayProperties();
[DllImport("gx.dll", EntryPoint = "#8")]
public static extern int OpenDisplay(IntPtr hwnd, DispFlags flags);
[DllImport("gx.dll", EntryPoint = "#2")]
public static extern int CloseDisplay();
[DllImport("gx.dll", EntryPoint = "#1")]
public static extern void* BeginDraw();
[DllImport("gx.dll", EntryPoint = "#4")]
public static extern int EndDraw();
[DllImport("gx.dll", EntryPoint = "#9")]
public static extern int OpenInput();
[DllImport("gx.dll", EntryPoint = "#3")]
public static extern int CloseInput();
[DllImport("gx.dll", EntryPoint = "#5")]
public static extern KeyList GetDefaultKeys(int options);
[DllImport("gx.dll", EntryPoint = "#12")]
public static extern int Suspend();
[DllImport("gx.dll", EntryPoint = "#10")]
public static extern int Resume();
[DllImport("gx.dll", EntryPoint = "#7")]
public static extern bool IsDisplayDRAMBuffer();
[DllImport("gx.dll", EntryPoint = "#11")]
public static extern int SetViewport(int top, int height, int reserved1, int reserved2);
}
}
Вроде бы на мобильных устройствах присутствует свой DirectX. Почему бы не писать на нём?
Imports GXGraphicsLibrary
Public Class Form1
Private gx As GXGraphics
Protected Overrides Sub OnPaintBackground(ByVal e As System.Windows.Forms.PaintEventArgs)
'MyBase.OnPaintBackground(e)
End Sub
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
'MyBase.OnPaint(e)
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Show()
Me.ControlBox = False
Me.Menu = Nothing
Me.WindowState = FormWindowState.Maximized
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
gx = New GXGraphics(Me, GXGraphicsLibrary.GXGraphics.DisplayBufferModes.kDoubleBuffer)
If gx.Inititialized = False Then
MsgBox("Initialization failed.", MsgBoxStyle.Critical, "Error")
End If
gx.SetDrawModes(GXGraphics.DrawFlags.kModeNoBoundsChecking)
Dim rc As New Rectangle
rc.Width = gx.ScreenWidth
rc.Height = gx.ScreenHeight
gx.BeginDraw()
gx.FillRect1(rc, Color.FromArgb(200, 120, 12))
gx.EndDraw()
End Sub
End Class
Теперь вопрос: можно ли как-то совместно с gapi использовать System.Drawing?
Как изменить ориентацию экрана для конкретного окна
MSDN писал(а):.NET Compact Framework requires a minimum of Windows CE.NET (Windows CE version 4.1 for the released version of the .NET Compact Framework) with two exceptions: Microsoft Pocket PC, Microsoft Pocket PC 2002, and Microsoft Pocket PC 2002 Phone Edition support the .NET Compact Framework. Smartphone 2002 does not support the .NET Compact Framework; however, Smartphone 2003 does.
MSDN писал(а):Windows Mobile 2003 for Pocket PC
Windows Mobile 2003 for Pocket PC SE
Windows Mobile Version 5.0 software for Pocket PCs
Windows Mobile Version 5.0 software for Smartphone
Windows CE 5.0
у многих ли стоит <WM2003SE?
Вернуться в Visual Basic для мобильных устройств
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 15