Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

delphi - how to retrieve exact text width for RenderText in Graphics32 -


i think question clear enough, explain more. simply, when using antialias on rendertext procedure, value gotten within textwidth function not correct. can right text width?

you can algorithm in own code. must calculate it. anyway how it.

function tgr32canvas.textwidth(const text: string): integer; var   tempfont: tfont;   tempwidth: integer; begin   if text <> ''   begin     tempfont := tfont.create;     try       tempfont.assign(font);       tempfont.size := font.size shl aa_mode;       tempwidth := gettextwidth(text, tempfont);           tempfont.free;     end;   end   else     tempwidth := 0;    tempwidth := (tempwidth shr aa_mode + 1) shl aa_mode;   result := tempwidth shr aa_mode; end; 

the gettextwidth function simple. can differently.

function gettextwidth(const text: string; const font: tfont): integer; var   canvas: tcanvas; begin   canvas := tcanvas.create;   try     canvas.handle := getdc(0);     try       canvas.font.assign(font);       result := canvas.textwidth(text);           releasedc(0, canvas.handle);     end;       canvas.free;   end; end; 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -