Advertisement
Advertisement
| 11.26.2007 at 11:04AM PST, ID: 22983176 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: |
unit ImageViewer;
interface
uses
SysUtils, Classes, Controls, ExtCtrls, StdCtrls,ExtDlgs,Forms,Graphics;
type
TImageViewer = class(TPanel)
private
{ Private declarations }
FLoadBmpBtn: TButton;
FExitBtn: TButton;
FInfoBtn: TButton;
FImage1: TImage;
FCreatedLabel: TLabel;
FSizeLabel: TLabel;
FSizeLabelCaption: TLabel;
procedure FExitBtnClick(Sender: TObject);
procedure FLoadBmpBtnClick(Sender: TObject);
function GetPicture:TPicture;
procedure SetPicture(Value:TPicture);
protected
{ Protected declarations }
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
{ Public declarations }
published
{ Published declarations }
property Picture:TPicture read GetPicture write SetPicture;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [TImageViewer]);
end;
constructor TImageViewer.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Caption:=' ';
SetBounds(Left,Top,260,345);
FLoadBmpBtn:=TButton.Create(Self);
FLoadBmpBtn.Parent:=Self;
FLoadBmpBtn.Caption:='Laod';
FLoadBmpBtn.SetBounds(85,305,80,25);
FLoadBmpBtn.Anchors:=[akBottom,akRight];
FLoadBmpBtn.OnClick:=FLoadBmpBtnClick;
FExitBtn:= TButton.Create(Self);
FExitBtn.Parent:=Self;
FExitBtn.Caption:='Exit';
FExitBtn.SetBounds(167,305,80,25);
FExitBtn.Anchors:=[akBottom,akRight];
FExitBtn.OnClick:=FExitBtnClick;
FInfoBtn:= TButton.Create(Self);
FInfoBtn.Parent:=Self;
FInfoBtn.Caption:='Info';
FInfoBtn.SetBounds(2,305,80,25);
FInfoBtn.Anchors:=[akBottom,akRight];
FImage1:=TImage.Create(Self);
FImage1.Parent:=Self;
FImage1.SetBounds(8,8,243,243);
FImage1.Anchors:=[akLeft,akTop,akRight,akBottom];
FImage1.Stretch:=True;
FSizeLabelCaption:= TLabel.Create(Self);
FSizeLabelCaption.Parent:=Self;
FSizeLabelCaption.SetBounds(8,256,32,13);
FSizeLabelCaption.Caption:='Size: ';
FSizeLabelCaption.Anchors:=[akBottom,akLeft];
FSizeLabel:= TLabel.Create(Self);
FSizeLabel.Parent:=Self;
FSizeLabel.SetBounds(FSizeLabelCaption.Left+FSizeLabelCaption.Width,256,32,13);
FSizeLabel.Caption:='0 X 0';
FSizeLabel.Anchors:=[akBottom,akLeft];
end;
destructor TImageViewer.Destroy;
begin
FSizeLabelCaption.Free;
FSizeLabel.Free;
FImage1.Free;
FInfoBtn.Free;
FLoadBmpBtn.Free;
FExitBtn.Free;
inherited;
end;
procedure TImageViewer.FExitBtnClick(Sender: TObject);
var c:TComponent;
begin
c:=Self;
While TWinControl(C).Parent<>nil do
begin
if TWinControl(C).Parent is TCustomForm then
begin
TCustomForm(TWinControl(C).Parent).Close;
Break;
end;
c:=TWinControl(C).Parent;
end;
{ if TWinControl(C).Parent is TCustomForm then
TCustomForm(TWinControl(C).Parent).Close;}
end;
procedure TImageViewer.FLoadBmpBtnClick(Sender: TObject);
var f:TOpenPictureDialog;
begin
f:=TOpenPictureDialog.Create(Self);
try
if f.Execute then
begin
FImage1.Picture.LoadFromFile(f.FileName);
FSizeLabel.Caption:=IntToStr(FImage1.Picture.Width)+' X '+
IntToStr(FImage1.Picture.Height);
end;
finally
f.Free;
end;
end;
function TImageViewer.GetPicture:TPicture;
begin
Result:=FImage1.Picture;
end;
procedure TImageViewer.SetPicture(Value:TPicture);
begin
FImage1.Picture.Assign(Value);
FSizeLabel.Caption:=IntToStr(FImage1.Picture.Width)+' X '+
IntToStr(FImage1.Picture.Height);
end;
end.
|