Picture orignal in RVF, but displaying smaller size. How?

General TRichView support forum. Please post your questions here
Post Reply
rv777
Posts: 61
Joined: Wed Dec 08, 2010 3:32 pm

Picture orignal in RVF, but displaying smaller size. How?

Post by rv777 »

I have an RichViewEdit in wich the inserted Images get save in its original size and resolution. RVFOptions has rvfoSavePicturesBody included. On save of that document, I write smaller images of all orignial images for Web usage with the OnHTMLSaveImage event.

Now I must load this files in a ReachView, but I want to load the reduced images for the Web and not the original ones stored in the RVF-File, as tehy should ony be visible in the Editor, but not in the Preview, as the preview should show as near as possible to the Internet browser.

How can I do that? The Event OnRVFNeedPicture isn't firing in this situation. :-(

Any Idea how I can override the default image handling to use my external smaller Web Images?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Is it possible, for each picture in the document, to find the corresponding web picture? If yes, you can enumerate all items in the document, and change all pictures using SetPictureInfo method.
rv777
Posts: 61
Joined: Wed Dec 08, 2010 3:32 pm

Post by rv777 »

Hmm, as I'm a new user to RV I have no idea how to do this exactly. Do you have some example für this and will this not extremly slow down the loading of that documents, as so every picturer gets two times loaded?

What do you think about to make the OnRVFNeedPicture fireing all the time a picture must be read, and not only if the image data is external? I see no problem to have this, but it will solve my and anyone elses problems for this situation. IMO this sounds like a nice additon to an upcoming release. Don't you think so too?
rv777
Posts: 61
Joined: Wed Dec 08, 2010 3:32 pm

Post by rv777 »

Sergey? Can you help me and what are you thinking about to make the event working all the time an image needs to load, if it is embedded or if not.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, I am afraid it's not a good idea, compatibility problems are possible.
rv777
Posts: 61
Joined: Wed Dec 08, 2010 3:32 pm

Post by rv777 »

Why should this be a compatibility problem? Anythin who used this event will still work as before and anything who didn't use it, is also still working. Any documents who uses embedded images were not using that event at all, so I can't see an incompatibility isue here.

What about a new event for this situation or a Property or a new Option which controlls the behavior of that event for embedded Images. The actual solution is very unpractical and ugly and slows down my displaying of the RVF-Data very much. As the user can browse through a dadaset and for every record it gets displayed, this loading should be as fast as possible.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

For example, application may provide some default picture in this event.
As a result of this change, all pictures in loaded document will be replaced to this default picture, because this event will be called for each picture.

Ok, I'll implement this feature, it will be activated with a compiler define.
rv777
Posts: 61
Joined: Wed Dec 08, 2010 3:32 pm

Post by rv777 »

Wouldn't it be fine if we can know if it is called for an ebedded image or not. In the situation were it is called for an ebedded image, we should also be able to tell RichView, it can use the default loading (the ebedded one) or not. The returned graphic may be nil (needs to use the default loading of the embedded image) or may not be nil if we load it our self. This will make that event very powerfull.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If I add a new parameter, the event will be incompatible with older versions.
If I load graphic in a gr parameter (so you will be able to distinguish nil and non-nil graphic), speed of loading will be the same as with post-processing images.
Post Reply