ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Text in memo disappears
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Andreas

Netherlands
2 Posts

Posted - Dec 09 2011 :  08:02:54  Show Profile  Reply
It seems the displayed margins in a memo-object are calculated incorrectly from TImageEnVect.ObjMemoMarginLeft/Right/Top/Bottom when zoomed-out. They were correctly calculated in version 3.0.1 but are incorrectly calculated in 3.1.1 The problem persists in 4.0.0.

The problem can be reproduced, using the following lines of code:

procedure TForm1.Button1Click(Sender: TObject);
var
lFileName: string;
lObjIdx: Integer;
lObjFont: TFont;
begin
if PromptForFileName(lFileName) then begin
ImageEnVect1.RemoveAllObjects;

ImageEnVect1.IO.LoadFromFileAuto(lFileName);
if ImageEnVect1.IO.Aborting then
raise Exception.Create('Invalid image');

lObjIdx := ImageEnVect1.AddNewObject;

ImageEnVect1.ObjKind[lObjIdx] := iekMemo;
ImageEnVect1.ObjBrushColor[lObjIdx] := clYellow; // clWebLightYellow;
ImageEnVect1.ObjBrushStyle[lObjIdx] := bsSolid;

ImageEnVect1.ObjMemoBorderColor[lObjIdx] := clMedGray;
ImageEnVect1.ObjPenColor[lObjIdx] := clBlack;

ImageEnVect1.ObjMemoMarginLeft[lObjIdx] := 5;
ImageEnVect1.ObjMemoMarginTop[lObjIdx] := 5;
ImageEnVect1.ObjMemoMarginRight[lObjIdx] := 5;
ImageEnVect1.ObjMemoMarginBottom[lObjIdx] := 5;

ImageEnVect1.ObjTextAlign[lObjIdx] := iejLeft;
ImageEnVect1.ObjTextEditable[lObjIdx] := False;

lObjFont := TFont.Create;
try
lObjFont.Color := clBlack;
lObjFont.PixelsPerInch := 300;
lObjFont.Size := 15;
lObjFont.Name := 'Tahoma'; // 'Tahoma Bold';

// lObjFont.PixelsPerInch := 110;
// lObjFont.Size := 30;
// lObjFont.Name := 'Verdana Bold';

ImageEnVect1.SetObjFont(lObjIdx, lObjFont);
finally
lObjFont.Free;
end;

ImageEnVect1.ObjText[lObjIdx] := AnsiString('WimMiw: ' + ExtractFileName(lFileName));

ImageEnVect1.ObjTop[lObjIdx] := 10;
ImageEnVect1.ObjLeft[lObjIdx] := 10;
ImageEnVect1.ObjWidth[lObjIdx] := 1200;
ImageEnVect1.ObjHeight[lObjIdx] := 200;
end;
end;


359.46 KB

I have noticed TIETextControl.PaintTo has changed between 3.0.1 and 3.1.1 and changing it back (remove PaintableRect-var etc.) to code similar to 3.0.1 fixes the problem.

Please could you inform me if other code is required for ImageEn-versions >= 3.1.1 or whether the behavior is just a bug?

Regards,
Andreas

fab

1310 Posts

Posted - Dec 10 2011 :  00:57:58  Show Profile  Reply
This bug has been fixed in version 4.0.1 (current is 4.0.2).
Here is how show your code in version 4.0.2:

Go to Top of Page

Andreas

Netherlands
2 Posts

Posted - Dec 12 2011 :  01:43:02  Show Profile  Reply
Great!!! Thanks Fabrizio.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: