Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Начинающим";
Текущий архив: 2005.11.20;
Скачать: [xml.tar.bz2];

Вниз

Как уменьшить JPG картинку.   Найти похожие ветки 

 
SamProf ©   (2005-10-27 15:10) [0]

Есть картинка JPG. Есть H - выстота и W - ширина! Как её сжать пропорционально в эти размеры?


 
Ega23 ©   (2005-10-27 15:28) [1]

StretchDraw ?


 
SamProf ©   (2005-10-27 15:43) [2]


> Ega23 ©   (27.10.05 15:28) [1]
>
> StretchDraw ?


А де его взять?


 
Ega23 ©   (2005-10-27 15:48) [3]


TCanvas.StretchDraw

Draws the graphic specified by the Graphic parameter in the rectangle specified by the Rect parameter.

procedure StretchDraw(const Rect: TRect; Graphic: TGraphic );

Description

Call StretchDraw to draw a graphic on the canvas so that the image fits in the specified rectangle. StretchDraw calls the Draw method of the graphic. The graphic object determines how to fit into the rectangle. This may involve changing magnification and/or aspect ratio.

To render the graphic in its natural size, use the Draw method, instead.

Graphics can be bitmaps, icons, or metafiles. If the graphic is a TBitmap object, the bitmap is rendered using the value of CopyMode.

Example

The following example is taken from the custom draw demo. It shows how the OnCustomDraw event handler draws the background for the tree view before the items and lines are drawn.

procedure TCustomDrawForm.TVCustomDraw(Sender: TCustomTreeView; const ARect: TRect; var DefaultDraw: Boolean);
begin
//This event should be used to draw any background colors or images.
//ARect represents the entire client area of the TreeView.
//Use the TreeView"s canvas to do the drawing.
//Note that drawing a background bitmap is not really supported by CustomDraw,
//so scrolling can get messy. Best to subclass the TreeView and handle scrolling

//messages.
 with TV.Canvas do
 begin
   if None1.Checked then //no picture
   begin
     Brush.Color := BkgColorDialog.Color;
     Brush.Style := FBrushStyle;
     FillRect(ARect);
   end else
     if Tile1.Checked then //tile bitmap
     begin
       Brush.Bitmap := Image1.Picture.Bitmap;
         FillRect(ARect);
       end else //Stretch across the canvas.

           StretchDraw(ARect, Image1.Picture.Bitmap);
 end;
 DefaultDraw := FDefaultDraw;
 //setting DefaultDraw to false here prevents all calls to OnCustomDrawItem.
end;


 
Gydvin ©   (2005-10-27 15:50) [4]

Bitmap.assign(jpeg);
bitmap.canvas.StretchDraw(код);
jpeg.assign(bitmap);

Вот с этим экспереминтируй


 
Gydvin ©   (2005-10-27 15:51) [5]

Ой опоздал



Страницы: 1 вся ветка

Форум: "Начинающим";
Текущий архив: 2005.11.20;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.036 c
2-1130694384
JBL
2005-10-30 20:46
2005.11.20
dbGrid


2-1131236042
pachkun
2005-11-06 03:14
2005.11.20
Группировка схожих компонентов.


4-1127131859
NightLord
2005-09-19 16:10
2005.11.20
Графика и WinApi


2-1131124075
Michael5
2005-11-04 20:07
2005.11.20
Как сделать форму, чтобы на нее можно было перетащить файл?


2-1131048460
Michael5
2005-11-03 23:07
2005.11.20
Написал функцию, возвращающую логическое значение. Пытаюсь





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский