delphi - Combining rotating and scaling functions of Graphics32 components -


good day. wanted incorporate 2 functions manipulate bitmap image. wanted rotate , scale same image. did use 1 of given examples, trotlayer. plan alter trotlayer. here's did.

tcustomaffinelayer = class(tbitmaplayer) private falphahit: boolean; ftransformation: taffinetransformation; fbitmap: tbitmap32; procedure bitmapchanged(sender: tobject); procedure setbitmap(value: tbitmap32); protected fbitmapcenter: tfloatpoint; procedure adjusttransformation; virtual; function dohittest(x, y: integer): boolean; override; procedure paint(buffer: tbitmap32); override; property transformation: taffinetransformation read ftransformation; public constructor create(alayercollection: tlayercollection); override; destructor destroy; override; property alphahit: boolean read falphahit write falphahit; property bitmap: tbitmap32 read fbitmap write setbitmap; end;  trotlayer = class(tcustomaffinelayer) private fposition: tfloatpoint; fscaled: boolean; fangle: single; procedure setangle(value: single); procedure setposition(const value: tfloatpoint); procedure setscaled(value: boolean); procedure setbitmapcenter(const value: tfloatpoint); protected procedure adjusttransformation; override; public property angle: single read fangle write setangle; property bitmapcenter: tfloatpoint read fbitmapcenter write setbitmapcenter; property scaled: boolean read fscaled write setscaled; property position: tfloatpoint read fposition write setposition; end; 

on first line, changed tcustomlayer tbitmaplayer can use location property of tbitmaplayer resizing , scaling of image. when started coding scaling part, couldn't seem make work using location property. here's code.

selected := trotlayer(imgview.layers.items[i]); frnewloc := selected.location;  **altered frnewloc values (left,right,top,bottom) here**  selected.location := frnewloc; 

it didn't work. did go wrong? or there component have scaling , rotating property in one? looking forward help. in advance.

delphi newbie here... :)


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -