Showing posts with label property. Show all posts
Showing posts with label property. Show all posts

Friday, September 09, 2011

Image Properties

 
 

1. AutoSize

true or false: 是否讓影像元件的寬、高隨著 Load 進來的影像大小自動調整。

2. Stretch

true or false: 是否讓 Load 進來的影像大小自動隨著影像元件的寬、高顯示出來。

3.

Tuesday, November 17, 2009

TCanvas::Pixels

TCanvas 有一個 property , 一般表示成 TCanvas::Pixels, 是我們常會用到的, Pixels 這個 property 可以讀出, 也可以寫入某個特定位置的色彩值, 因此這個 property 的類別為 TColor。在 BCB Help 中的說明如下:
TCanvas::Pixels
Specifies the color of the pixels within the current ClipRect.

__property TColor Pixels[int X][int Y] = {read=GetPixel, write=SetPixel};

Description
Read Pixels to learn the color on the drawing surface at a specific pixel position within the current clipping region. If the position is outside the clipping rectangle, reading the value of Pixels returns -1.

Write Pixels to change the color of individual pixels on the drawing surface. Use Pixels for detailed effects on an image. Pixels may also be used to determine the color that should be used for the FillRect method.

Not every device context supports the Pixels property. Reading the Pixels property for such a device context will return a value of -1. Setting the Pixels property for such a device context does nothing.

Monday, March 23, 2009

TBitmap::ScanLine

Provides indexed access to each line of pixels.

__property void * ScanLine[int Row] = {read=GetScanline};

Description

ScanLine is used only with DIBs (Device Independent Bitmaps) for image editing tools that do low-level pixel work.


基本上, ScanLine 是 TBitmap 元件中的一個 Property, 存放著 Bitmap 某一橫列的色彩值在記憶體中存放的起始指標, 有了這個指標, 我們就可以直接在記憶體中直接存取, 修改影像內容。
 
更新記憶體後的影像元件的外觀顯示, 有可能和記憶體中不相符, 我們可以用 Refresh() 這個 method 來將影像的外觀重新顯示。

  Image1->Refresh();