Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rotating an image, omg I cant !!!
01-03-2013, 06:46 AM (This post was last modified: 01-03-2013 06:50 AM by oliveiracarlos.)
Post: #5
RE: Rotating an image, omg I cant !!!
Thanks for reply Dave.

But yes, its cmCenter. No matter what I do, I cant center the button.

If you have some time to help, appreciate that: https://docs.google.com/open?id=0B-WCIyM...lI4dDlBdWc
(Its a Delphi XE project)

all the code is as following...
Code:
unit uKnobButton;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, LPControl, SLControlCollection, VLCommonDisplay, VLImageDisplay,
  SLCommonGen, VLCommonGen, VLImageGen, LPComponent, SLCommonFilter,
  VLCommonFilter, VLRotate, VLAVIPlayer, VLDSImageDisplay, MLDSPlayer,
  VLDSVideoPlayer, VLGrayScale, StdCtrls, Jpeg, pngimage, GIFImg, VLWarp,
  ExtCtrls, VLBasicGenericFilter, VLGenericFilter, ComCtrls;

type
  TForm1 = class(TForm)
    VLDSImageDisplay1: TVLDSImageDisplay;
    Image2: TImage;
    TrackBar1: TTrackBar;
    VLRotate1: TVLRotate;
    procedure TrackBar1Change(Sender: TObject);
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

  var
img : TBitmap;
jpg : TPicture;

implementation

{$R *.dfm}

procedure TForm1.FormActivate(Sender: TObject);
begin
jpg := TPicture.Create;
jpg.LoadFromFile('D:\jucerun\delphi\MidiDelphi\VolumeKnob.jpg');

img := TBitmap.Create;
img.Width := 121;
img.Height := 121;
img.Canvas.Draw(0,0,jpg.Graphic);

VLDSImageDisplay1.DisplayBitmap(img);
end;

procedure TForm1.TrackBar1Change(Sender: TObject);
begin
VLRotate1.Angle := TrackBar1.Position;
VLRotate1.ProcessBitmap(img,image2.Picture.Bitmap);
end;

end.

Code:
object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 225
  ClientWidth = 341
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  OnActivate = FormActivate
  PixelsPerInch = 96
  TextHeight = 13
  object Image2: TImage
    Left = 200
    Top = 16
    Width = 121
    Height = 121
  end
  object VLDSImageDisplay1: TVLDSImageDisplay
    Left = 16
    Top = 16
    Width = 121
    Height = 121
    AspectRatio.Width = 4
    AspectRatio.Height = 3
    Graph.AdditionalFilters = <>
  end
  object TrackBar1: TTrackBar
    Left = 16
    Top = 168
    Width = 305
    Height = 45
    Max = 360
    TabOrder = 1
    OnChange = TrackBar1Change
  end
  object VLRotate1: TVLRotate
    WorkArea.Width = 1
    WorkArea.Height = 1
    BackgroundColor = clWhite
    SmoothEdge = False
    Left = 152
    Top = 67
    _Floats = (
      (
        Angle
        0.000000000000000000))
  end
end

thanks in advanced.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Rotating an image, omg I cant !!! - Dave - 01-03-2013, 01:26 AM
RE: Rotating an image, omg I cant !!! - Dave - 01-03-2013, 05:10 AM
RE: Rotating an image, omg I cant !!! - oliveiracarlos - 01-03-2013 06:46 AM
RE: Rotating an image, omg I cant !!! - Dave - 01-03-2013, 10:54 AM
RE: Rotating an image, omg I cant !!! - Dave - 01-04-2013, 09:16 AM
RE: Rotating an image, omg I cant !!! - Dave - 01-05-2013, 06:07 AM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)