trichview.com

trichview.support




Re: Image resizing and printing


Return to index


Author

Message

Sergey Tkachenko

Posted: 11/26/2004 22:59:28


Yes, you can do it using rvepImageWidth and rvepImageHeight extra item

properties.

This example adds picture at the caret position and resizes it to 32x32

(this insertion and resizing can be undone/redone as a single operation):


var bmp: TBitmap;

    rve: TCustomRichViewEdit;

begin

  bmp := TBitmap.Create;

  bmp.LoadFromFile('d:\New Bitmap Image.bmp');

  rve := RichViewEdit1.TopLevelEditor;

  rve.BeginUndoGroup(rvutInsert);

  rve.SetUndoGroupMode(True);

  if RichViewEdit1.InsertPicture('', bmp, rvvaBaseline) then begin

    RichViewEdit1.SetCurrentItemExtraIntProperty(rvepImageHeight, 32,

False);

    RichViewEdit1.SetCurrentItemExtraIntProperty(rvepImageWidth, 32, True);

  end;

  rve.SetUndoGroupMode(False);

end;


This example creates document with this image:


var bmp: TBitmap;

    rve: TCustomRichViewEdit;

begin

  bmp := TBitmap.Create;

  bmp.LoadFromFile('d:\New Bitmap Image.bmp');

  rve := RichViewEdit1.TopLevelEditor;


  RichViewEdit1.Clear;

  RichViewEdit1.AddNL('Image 32x32', 0, 0);

  RichViewEdit1.AddPictureEx('', bmp, 0, rvvaBaseline);

  RichViewEdit1.SetItemExtraIntProperty(RichViewEdit1.ItemCount-1,

rvepImageWidth, 32);

  RichViewEdit1.SetItemExtraIntProperty(RichViewEdit1.ItemCount-1,

rvepImageHeight, 32);

  RichViewEdit1.Format;

end;



>

> Hi.

> I've got one more question. It's about image printing.

> How can I make some kind of IMAGE object in TRichView with DEFINED size.

> I want to print small logo at the top of the page, but when I'm inserting

> a small image - it is so PIXELIZED (low resolution) when printing.

> I want to add BIG image and assign its width and height so it look like a

> small image, but with high resolution when printing...

>

> thanx in advance





Powered by ABC Amber Outlook Express Converter