Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
8
Erster Beitrag:
vor 5 Jahren, 1 Monat
Letzter Beitrag:
vor 5 Jahren
Beteiligte Autoren:
Scott Daughtry, Arie, Yogi Yang, Paulo Oliveira, Fabrice Harari

Popup window to display BLOB stored image

Startbeitrag von Scott Daughtry am 14.11.2012 17:26

Hoping to not recreate the wheel, but can't find an example within the WD17 examples / tutorials.

My HF database stores image files inside of a BLOB (aka: memo) field. I've learned that whenever images are displayed on a window, if you right click on the image and copy it to the clipboard (via the popup menu) that the pasted image is the exact same size as displayed in the WD17 application.

I would prefer that when the image is clicked that a popup window will appear that displays the image - the popup window would be sized to about 75% of the application's main screen. If the image is smaller than the popup window, it is displayed 100% (i.e. not enlarged, which could cause it to look distorted due to pixelation). If the image is larger than the popup window's size, the image is shrunken to fit the window.

Does WD17 include something like this that I've not found, or has anyone created something like this that they would be willing to share?

Antworten:

Hi Scott

I'm sorry, but I must be missing something. Your description seems to indicate that you want a simple window with an image field in it and a right clic that does an OPEN of this window...

There must be something else to it

Best regards

von Fabrice Harari - am 14.11.2012 18:17
Hi Fabrice,

Better example (hopefully ) - envision a WD17 window with a table control that also has an image control placed onscreen - as each new selection occurs within the table control the image is updated from the *.MMO. I want to enable the user to left click on the image control, which will popup a new window to display the image file stored in the *.MMO. I want the popup window's image control to either display the image in it's natural size if it's smaller than the image control, and if the image is physically larger than the popup window's image control to reduce it to fit the image control without distortion. If I take the concept a little farther, I would add buttons within the popup window to save the image (in it's stored, physical size instead of the image control's size) to the hard drive; copy the image to the Windows clipboard (again, using the actual size of the stored image instead of the image control's defined size), and add zoom in / zoom out controls.

Cheers,
Scott

von Scott Daughtry - am 15.11.2012 04:12
Scott,
if I understand you correctly you just have to set the image controls 'display mode' to homothetic or homothetically centered.

von Arie - am 15.11.2012 08:58
Hi Arie,

How would / could I copy the image to the Windows clipboard using the image's physical size versus the image control's size?

Cheers,
Scott

von Scott Daughtry - am 15.11.2012 14:41
Scott,
one trick could be to add an extra invisible (or placed outside the window) image control and resize it according to the image, at runtime when loading the image.
And then use ToClipboard

von Arie - am 15.11.2012 14:53
Hi scott
I'm just guessing, i never used it this way but...
why don't you try using one image variable instead of the image control and use the Properties Height/Width of the image variable to change the size of the image control and copy the control to the clipboard after changing is size.

http://doc.windev.com/en-US/?1000019650
http://doc.windev.com/en-US/?1000019656

von Paulo Oliveira - am 15.11.2012 14:54
I think the code you are looking for is can be something like this:

ImageId=LSV_My_Image..DisplayedValue
Open(FrmImageView)

The window FrmImageView in Initialization you will have to write some code like this:


IF FrmMain.ImageId > 0 THEN
// Image Get In Patient Image Table
HReadSeekFirst(Patient_Image,Pateint_ImageID,FrmMain.ImageId)
IMG_Image1=Patient_Image.Pai_Image
END




HTH

Yogi Yang

PS: I am not sure as to how this code will work as I have just cobbled it togather, but do give it a try at your end.

von Yogi Yang - am 20.11.2012 14:32
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.