Recent

Author Topic: InsertImageFromFile - RichMemo doesn't show images.  (Read 402 times)

wekwejt.com

  • New member
  • *
  • Posts: 7
InsertImageFromFile - RichMemo doesn't show images.
« on: April 06, 2022, 05:50:40 pm »
Hi,
I use RichMemo i Lazarus 2.0.12 and I gonna to insert images to RichMemo and save it in rtf file, but after use InsertImageFromFile there is no any picture content visible. Only thing I see is frame with icon and name. See attachment.

Does someone know how to place a picture in right way?
« Last Edit: April 06, 2022, 05:53:40 pm by wekwejt.com »

HeavyUser

  • Sr. Member
  • ****
  • Posts: 381
Re: InsertImageFromFile - RichMemo doesn't show images.
« Reply #1 on: April 07, 2022, 01:12:39 am »
Richmemo does not support images, there was an other control that supported images, in windows at least, but I do not recall its name at this time.

rvk

  • Hero Member
  • *****
  • Posts: 4834
Re: InsertImageFromFile - RichMemo doesn't show images.
« Reply #2 on: April 07, 2022, 10:29:51 am »
Richmemo does not support images, there was an other control that supported images, in windows at least, but I do not recall its name at this time.
What do you mean "Richmemo does not support images" ????

See attached screenshot.

It's just... what kind of image. I see in the starttopic an icon for IrfanView. So the actual image can be anything (also something Richmemo (riched20.dll) can't handle).

Also... what OS is this. On Windows Richmemo uses riched20.dll and it can handle some images fine.
For attached screenshot I just dragged a png image to the Richmemo. jpg work fine too.

The problem with InsertImageFromFile is that it inserts the image as object/file.
When you drag the image, riched20.dll does some extra work to create a preview which is actually displayed in the window.
Because InsertImageFromFile does not do that, you see a generic image.
Maybe you are better of pasting the image via clipboard programmatically (in which case the preview should be visible).
(i have no example code at the moment for that)
« Last Edit: April 07, 2022, 10:43:16 am by rvk »

 

TinyPortal © 2005-2018