ملاحظة
موقف نقطة الربط النسبي إلى التسمية يمكن اختيارها من ENUM_ANCHOR_POINT التعداد. يتم تعيين مرساة إحداثيات نقطة بالبكسل.
يمكنك أيضا تحديد نقطية الزاوية رسو من ENUM_BASE_CORNER التعداد.
لتسمية نقطية، يمكنك تحديد نطاق الرؤية للصورة.
مثال
السيناريو التالي بإنشاء العديد من الصور النقطية على الرسم البياني. وقد وضعت وظائف خاصة لخلق وتغيير خصائص الكائن الرسومي ل. يمكنك استخدام هذه الوظائف "كما هي" في التطبيقات الخاصة بك.
#property صارم
// --- وصف
#property وصف "سيناريو يخلق \" "وجوه". نقطية تسمية \
// --- نافذة العرض للمعلمات الإدخال خلال إطلاق البرنامج النصي
#property script_show_inputs
// --- معلمات الإدخال من السيناريو
مساهمة سلسلة InpName = "BmpLabel"؛ // اسم العلامة
مساهمة سلسلة InpFileOn = "\\ صور \\ dollar.bmp"؛ // اسم الملف للوضع في
مساهمة سلسلة InpFileOff = "\\ صور \\ euro.bmp"؛ // اسم الملف لوضع معطلة
مساهمة منطقي InpState = كاذبة؛ // تسمية الضغط / أفرجت
مساهمة ENUM_BASE_CORNER InpCorner = CORNER_LEFT_UPPER؛ // ركن الرسم البياني لرسو
مساهمة ENUM_ANCHOR_POINT InpAnchor = ANCHOR_CENTER، نوع // مرساة
مساهمة اللون InpColor = clrRed؛ // لون الحدود عندما سلط الضوء
مساهمة ENUM_LINE_STYLE InpStyle = STYLE_SOLID؛ // نمط الخط عندما سلط الضوء
مساهمة الباحث InpPointWidth = 1؛ // حجم نقطة للتحرك
مساهمة منطقي InpBack = كاذبة؛ // الكائن الخلفية
مساهمة منطقي InpSelection = كاذبة؛ // تسليط الضوء على هذه الخطوة
مساهمة منطقي InpHidden = صحيح؛ // المخفية في قائمة الكائنات
مساهمة طويل InpZOrder = 0؛ // الأولوية للنقرة ماوس
// + ----------------------------------------------- ------------------- +
// | انشئ الكائن تسمية نقطية |
// + ----------------------------------------------- ------------------- +
منطقي BitmapLabelCreate (CONST chart_ID طويلة = 0، // ID الرسم البياني لل
CONST اسم سلسلة = "BmpLabel"، // اسم التسمية
CONST الباحث sub_window = 0، // subwindow مؤشر
CONST الباحث س = 0، // X تنسيق
CONST الباحث ص = 0، // Y تنسيق
CONST سلسلة file_on = ""، // صورة في وضع كود
CONST سلسلة file_off = ""، // صورة في وضع معطلة
CONST عرض الباحث = 0، // نطاق الرؤية X تنسيق
CONST الباحث الارتفاع = 0، // نطاق الرؤية Y تنسيق
CONST الباحث x_offset = 10، // نطاق الرؤية التحول من محور X
CONST الباحث y_offset = 10، // نطاق الرؤية التحول من محور Y
CONST الدولة منطقي = كاذبة، // ضغط / صدر
CONST ENUM_BASE_CORNER الزاوية = CORNER_LEFT_UPPER، // الرسم البياني الزاوية لترسيخ
CONST ENUM_ANCHOR_POINT مرساة = ANCHOR_LEFT_UPPER، // نوع مرساة
CONST لون CLR = clrRed، // لون الحدود عندما سلط الضوء
CONST أسلوب ENUM_LINE_STYLE = STYLE_SOLID، // نمط الخط عندما سلط الضوء
CONST الباحث point_width = 1، // حجم نقطة التحرك
CONST منطقي الظهر = كاذبة، // في الخلفية
CONST اختيار منطقي = كاذبة، // تسليط الضوء على هذه الخطوة
CONST منطقي خفية = صحيح، // مخبأة في قائمة الكائنات
CONST z_order طويلة = 0) // الأولوية لنقرة ماوس
{
// --- إعادة تعيين قيمة الخطأ
ResetLastError ()؛
// --- إنشاء تسمية نقطية
إذا (! ObjectCreate (chart_ID والاسم وOBJ_BITMAP_LABEL، sub_window، 0،0))
{
الطباعة (__FUNCTION__،
": فشل في خلق \" نقطية تسمية \ "رمز الخطأ الكائن =!"، يقوم GetlastError ())؛
العودة (كاذبة)؛
}
// --- تعيين الصور لوإيقاف وسائط
إذا (! ObjectSetString (chart_ID والاسم وOBJPROP_BMPFILE، 0، file_on))
{
الطباعة (__FUNCTION__،
": فشل تحميل صورة للوضع كود خطأ ="، يقوم GetlastError ())؛
العودة (كاذبة)؛
}
إذا (! ObjectSetString (chart_ID والاسم وOBJPROP_BMPFILE، 1، file_off))
{
الطباعة (__FUNCTION__،
": فشل تحميل صورة للوضع معطلة رمز الخطأ ="، يقوم GetlastError ())؛
العودة (كاذبة)؛
}