Library "imlib"

Description
The library allows you to display images in your scripts utilising the <table> objects. You can change the image size and screen aspect ratio (the ratio of width to height which you can change if the image is too wide / tall). The library has "example()" function which you can use to see how it works. It also has a handy "logo()" function which you can use to quickly display an image by passing the "Image data string", table position, image size and aspect ratio. And of course you can use it in your own custom way by taking the "logo()" function as an example and modifying the code to your needs.

Since tables in Pinescript are limited to 100 by 100 cells, the limit for image's size is also 100x100 px. All the necessary data to display an image is passed as a string variable, and since Pinescript has a limit of 4096 characters for variables of <string> type, that string can have a maximum length of 4096 characters, which is enough to display a 64x64px image (but can be enough to display a 100x100 image, depending on the image itself).

Below you can find the definitions of functions for this library.

_decompress(data)
  : Decompresses string with data image
  Parameters:
    data (string)
  Returns: : Array of <string> with decompressed data

load(data)
  : Splits the string with image data into components and builds an <ImgData> object
  Parameters:
    data (string)
  Returns: : An <ImgData> object

show(imgdata, table_id, image_size, screen_ratio)
  : Displays an image in a table
  Parameters:
    imgdata (ImgData)
    table_id (table)
    image_size (float)
    screen_ratio (string)
  Returns: : nothing

example()
  : Use it as an example of how this library works and how to use it in your own scripts
  Returns: : nothing

logo(imgdata, position, image_size, screen_ratio)
  : Displays logo using image data string
  Parameters:
    imgdata (string)
    position (string)
    image_size (float)
    screen_ratio (string)
  Returns: : nothing

ImgData
  Fields:
    w (series__integer)
    h (series__integer)
    s (series__string)
    pal (series__string)
    data (array__string)
ไลบรารีไพน์

จิตวิญญาณที่แท้จริงของ TradingView ผู้เขียนได้ตีพิมพ์รหัส Pine นี้เป็นไลบรารีโอเพนซอร์ซเพื่อให้โปรแกรมเมอร์คนอื่น ๆ จากชุมชนของเราสามารถนำไปใช้ซ้ำได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ไลบรารีนี้เป็นการส่วนตัวหรือในสิ่งพิมพ์โอเพนซอร์สอื่น ๆ แต่นำรหัสนี้มาใช้ซ้ำในสิ่งพิมพ์จะถูกควบคุมโดย กฎระเบียบการใช้งาน

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการใช้ไลบรารีนี้หรือไม่?

คัดลอกข้อความไปยังคลิปบอร์ดแล้ววางลงในสคริปต์ของคุณ