Example #1
0
 public DataSource(FileMap map)
 {
     Address = map.Address;
     Length = map.Length;
     Map = map;
 }
Example #2
0
 private void InitFont(Font font)
 {
     if (hFont)
     {
         WinAPI.DeleteObject(hFont);
     }
     hFont = font.ToHfont();
     if (hdcWindow)
     {
         WinAPI.SelectObject(hdcWindow, hFont);
         WinAPI.GetTextMetrics(hdcWindow, out textMetric);
         forceRedraw = true;
         Invalidate();
     }
 }
Example #3
0
 private void ResizeBackBuffer(Size newSize)
 {
     WinAPI.DeleteObject(hBackBuffer);
     hBackBuffer = WinAPI.CreateCompatibleBitmap(hdcWindow, newSize.Width, newSize.Height);
     backBufferSize = newSize;
     WinAPI.SelectObject(hdcBackBuffer, hBackBuffer);
     ClearRect(hdcBackBuffer, RECT.FromSize(newSize));
 }
Example #4
0
 public static extern bool SetTextAlign(VoidPtr hdc, TextAlignTypes fmode);
Example #5
0
 public static extern bool TextOut(VoidPtr hdc, int nXStart, int nYStart, StringBuilder lpString, int cbString);
Example #6
0
 public static extern bool ScrollDC(VoidPtr hDC, int dx, int dy, RECT* lprcScroll, RECT* lprcClip, VoidPtr hrgnUpdate, RECT* lprcUpdate);
Example #7
0
 public static extern int SetBkMode(VoidPtr hdc, BkModeTypes iBkMode);
Example #8
0
 public static extern VoidPtr DefWindowProc(VoidPtr hWnd, uint uMsg, VoidPtr wParam, VoidPtr lParam);
Example #9
0
 public static extern bool DeleteDC(VoidPtr hdc);
Example #10
0
 public static extern VoidPtr CreateCompatibleDC(VoidPtr hdc);
Example #11
0
 public static extern VoidPtr CreateDC(string lpszDriver, string lpszDevice, string lpszOutput,
     VoidPtr lpInitData);
Example #12
0
 public static extern VoidPtr CreateCompatibleBitmap(VoidPtr hdc, int nWidth, int nHeight);
Example #13
0
 public static extern bool BitBlt(VoidPtr hObject, int nXDest, int nYDest, int nWidth,
     int nHeight, VoidPtr hObjSource, int nXSrc, int nYSrc, TernaryRasterOperations dwRop);
Example #14
0
 public void Close()
 {
     if (Map != null) { Map.Dispose(); Map = null; }
     Address = null;
     Length = 0;
 }
Example #15
0
 public static extern bool GetTextMetrics(VoidPtr hdc, out TEXTMETRIC lptm);
Example #16
0
 public static extern bool DeleteObject(VoidPtr hObject);
Example #17
0
 public static extern int ReleaseDC(VoidPtr hwnd, VoidPtr hDC_Screen);
Example #18
0
 public static extern bool ExtTextOut(VoidPtr hdc, int X, int Y, uint fuOptions,
     ref RECT lprc, string lpString, uint cbCount, int[] lpDx);
Example #19
0
 public static extern VoidPtr SelectObject(VoidPtr hdc, VoidPtr hObject);
Example #20
0
 public static extern int FillRect(VoidPtr hDC, ref RECT lprc, VoidPtr hbr);
Example #21
0
 public static extern bool SetTextAlign(VoidPtr hdc, uint fmode);
Example #22
0
 public static extern BkModeTypes GetBkMode(VoidPtr hdc);
Example #23
0
 public static extern uint SetTextColor(VoidPtr hdc, uint crColor);
Example #24
0
 public static extern VoidPtr GetDC(VoidPtr hWnd);
Example #25
0
 public static extern bool TextOut(VoidPtr hdc, int nXStart, int nYStart, char* lpString, int cbString);
Example #26
0
 public static extern VoidPtr GetDCEx(VoidPtr hwnd, VoidPtr hrgnclip, uint fdwOptions);
Example #27
0
 protected override void OnHandleCreated(EventArgs e)
 {
     base.OnHandleCreated(e);
     hWindow = Handle;
     hdcWindow = WinAPI.GetDC(hWindow);
     Debug.Assert(hdcWindow, "Unable to get DC");
     InitFont(Font);
     hdcBackBuffer = WinAPI.CreateCompatibleDC(hdcWindow);
     Debug.Assert(hdcBackBuffer, "Unable to create Compatible DC");
     backBufferSize = GetGranulatedClientSize();
     hBackBuffer = WinAPI.CreateCompatibleBitmap(hdcWindow, backBufferSize.Width, backBufferSize.Height);
     Debug.Assert(hBackBuffer, "Unable to create Compatible Bitmap");
     hBackBrush = WinAPI.GetStockObject(StockObjects.BLACK_BRUSH);
     Debug.Assert(hBackBrush, "Unable to create SolidBrush");
     hSelectionBrush = WinAPI.CreateSolidBrush(ConsoleColors.DarkGray);
     Debug.Assert(hSelectionBrush, "Unable to create SolidBrush");
     WinAPI.SelectObject(hdcBackBuffer, hBackBuffer);
     ClearRect(hdcBackBuffer, RECT.FromSize(backBufferSize));
     WinAPI.SetBkMode(hdcBackBuffer, WinAPI.BkModeTypes.OPAQUE);
     WinAPI.SetBkColor(hdcBackBuffer, ConsoleColors.Black);
 }
Example #28
0
 public static extern bool GetTextExtentPoint32(VoidPtr hdc, string lpString, int cbString, out Size lpSize);
Example #29
0
 private void ClearRect(VoidPtr hdc, RECT rect)
 {
     WinAPI.FillRect(hdc, ref rect, hBackBrush);
 }
Example #30
0
 public DataSource(VoidPtr addr, int len)
 {
     Address = addr;
     Length = len;
     Map = null;
 }