• ¡Welcome to Square Theme!
  • This news are in header template.
  • Please ignore this message.
مهمان عزیز خوش‌آمدید. ورود عضــویت


امتیاز موضوع:
  • 6 رای - 3 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
Title: رنگ و پیکسل تصاویر
حالت موضوعی
#1
Brick 
سلام  به همه ی  دوستان در ویژوال این امکان وجود داره که یک کد بنویسیم رنگهای موجود در یک تصویر رو شناسایی و به ترتیب به رنگها شماره بده مثلا از کمرنگ به پر رنگ شماره گذاری کنه  و شماره پیکسل هایی که رنگ ها در اون قرار دارن رو به ما بده بعد رنگ ها رو همراه کدشون به ما نشون بده اگر کمکم کنید خیلی ممنون میشم
 
پاسخ
#2
درود
خوش امدید
بله این امکان در وی بی 6 هست
یک سمپل :
The Point method returns the color value of a given pixel, but is rather slow because it has to convert its argument from twips (or whatever ScaleMode is currently active) to pixels, and also because its argument are treated as Single quantities, and must therefore converted. When you have to retrieve the color value of many pixels you should use the GetPixel API function instead. Here is its declaration:

کد:
Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, _
    ByVal y As Long) As Long

The following code example counts the number of red pixels on the active form:
کد:
' assumes that form's ScaleMode
' is set to 3 - Pixels
Dim x As Long, y As Long
Dim h As Long, count As Long
' cache form's hDC property
h = Me.hdc
For y = 0 To ScaleHeight - 1
    For x = 0 To ScaleWidth - 1
        If GetPixel(h, x, y) = vbRed Then
            count = count + 1
        End If
    Next
Next
It is about three times faster than the equivalent code that uses the Point method. Note that we can have this speed increment also because we cache the hDC property into a variable.
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
  


موضوعات مشابه ...
موضوع نویسنده پاسخ بازدید آخرین ارسال
  بدست اوردن رنگ پیکسل عکس ها Amin_Mansouri 0 4,200 02-28-2012، 01:54 AM
آخرین ارسال: Amin_Mansouri
  درخواست سورسی که حجم تصاویر را کاهش می دهد download69 4 3,571 06-04-2011، 10:07 PM
آخرین ارسال: download69

پرش به انجمن:


Browsing: 1 مهمان