07-17-2012, 07:39 PM
พอดีว่าผมกำลังยำสคริปต์ใหม่ๆ อยู่นะครับ แล้วลองเปิดดู
ครั้งแรก
พอกด F12 ปุ๊บ
พอมาดูสริปต์
ใครก็ได้ช่วยผมที ขอบคุณล่วงหน้า
ครั้งแรก
พอกด F12 ปุ๊บ
พอมาดูสริปต์
Code:
#==============================================================================
# ** Bitmap
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias admannon_bitmap_initialize initialize
def initialize(*args)
admannon_bitmap_initialize(*args)
@BitmapPlusDLL = "D:/Peerakarn/Documents/C Language/BitmapPlus/bin/Debug/"
end
#--------------------------------------------------------------------------
# * Get/Set Bitmap Plus DLL
#--------------------------------------------------------------------------
def BitmapPlusDLL
return @BitmapPlusDLL
end
def BitmapPlusDLL=(bmpdll)
@BitmapPlusDLL = bmpdll
end
#--------------------------------------------------------------------------
# * Get Color Zone
#--------------------------------------------------------------------------
def color_zone()
dll = Win32API.new(@BitmapPlusDLL + "BitmapPlus.dll", "Trim", "ll", "l")
area = Rect.new(0, 0, 0, 0)
area.x = dll.call(self.__id__, 0)
area.y = dll.call(self.__id__, 1)
area.width = dll.call(self.__id__, 2) - area.x
area.height = dll.call(self.__id__, 3) - area.y
return area
end
#--------------------------------------------------------------------------
# * Text Size
#--------------------------------------------------------------------------
alias bitmap_text_size text_size
def text_size(str, trimmode = false)
if trimmode
text_size = Size.new
text = Bitmap.new(640, self.font.size + 12)
text.draw_text(0, 0, 640, font.size + 12, str, 1)
text_size.width = text.color_zone.width + 2
text_size.height = $font_height
return text_size
else
return bitmap_text_size(str)
end
end
end
ใครก็ได้ช่วยผมที ขอบคุณล่วงหน้า