Page 1 of 1
Picture orignal in RVF, but displaying smaller size. How?
Posted: Wed Jan 12, 2011 1:47 pm
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?
Posted: Wed Jan 12, 2011 7:13 pm
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.
Posted: Mon Jan 17, 2011 5:47 pm
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?
Posted: Fri Jan 21, 2011 12:45 pm
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.
Posted: Sat Jan 22, 2011 8:44 pm
by Sergey Tkachenko
Sorry, I am afraid it's not a good idea, compatibility problems are possible.
Posted: Sun Jan 23, 2011 1:55 pm
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.
Posted: Tue Jan 25, 2011 6:33 pm
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.
Posted: Wed Jan 26, 2011 3:09 pm
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.
Posted: Wed Jan 26, 2011 5:20 pm
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.