Вопрос: Несколько вопросиков | Добавлено: 05.04.06 17:20 |
Автор вопроса: ![]() |
Ответы | Всего ответов: 17 |
Номер ответа: 16 Автор ответа: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ICQ: 229759992 Вопросов: 14 Ответов: 93 |
Профиль | Цитата | #16 | Добавлено: 06.04.06 18:48 |
Народ .Point(x, y) возвращяет 2696026
В каком это формате. Нужно посчитать % пикселей 1 цвета в линии. Загвоздка в том что чуть ниже написанны цифры и они как бы накладывают свой отпечаток. Цвет чуть-чуть меняется , хотя по сути тот-же. Вот я и сижу мучаюсь , не могу понять как научить бейсик понимать что сходные пиксели одинаковы и их тоже считать нужно |
Номер ответа: 17 Автор ответа: ![]() ![]() ICQ: 255004422 Вопросов: 0 Ответов: 14 |
Профиль | Цитата | #17 | Добавлено: 08.04.06 11:13 |
' Vot tak esli ya ponyal tebya:
' ( a kak poluchit cvet piksela et uje dosttochno obyasnili) //================================= Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Const SRCCOPY = &HCC0020 ' Copy the desktop's image into the form. Private Sub GetScreenImage() Dim desktop_rect As RECT Dim desktop_win As Long Dim desktop_dc As Long Dim desktop_wid As Long Dim desktop_hgt As Long Dim x As Long Dim y As Long Dim wid As Long Dim hgt As Long desktop_win = GetDesktopWindow() desktop_dc = GetDC(desktop_win) GetWindowRect desktop_win, desktop_rect desktop_wid = desktop_rect.Right desktop_hgt = desktop_rect.Bottom x = 0 wid = desktop_wid y = 0 hgt = desktop_hgt Width = ScaleX(Width - ScaleWidth + wid, vbPixels, vbTwips) Height = ScaleY(Height - ScaleHeight + hgt, vbPixels, vbTwips) StretchBlt hdc, x, y, wid, hgt, desktop_dc, 0, 0, desktop_wid, desktop_hgt, SRCCOPY Picture = Image ReleaseDC desktop_win, desktop_dc End Sub Private Sub Command1_Click() GetScreenImage End Sub |
|