Show and scroll with Meta-file

Post Reply
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Show and scroll with Meta-file

Post by Marc Vanzegbroeck »

Hi,

I'm creating drawings in meta-files, and show them in a window.
Sometimes the drawings ar larges than the screen, and want to move around like Adobe-reader.
Image
How can I do this?
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Show and scroll with Meta-file

Post by nageswaragunupudi »

can you please send me a sample metafile by email?
nageswaragunupudi [at] gmail [dot] com
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Show and scroll with Meta-file

Post by nageswaragunupudi »

First please try this.
We will make some more improvements.

Code: Select all

   local oDlg, oImage
   local cFile := "NW1151L.emf"

   DEFINE DIALOG oDlg SIZE 900,600 PIXEL TRUEPIXEL

   @ 20,20 XIMAGE oImage SOURCE cFile SIZE -20,-20 OF oDlg

   ACTIVATE DIALOG oDlg CENTERED
 
You can zoom and unzoom with mouse scroll and pan the image by dragging with mouse.
Btw, you can also use fingers on a touch screen to zoom/unzoom and pan the image on a touch screen.

Image
Regards

G. N. Rao.
Hyderabad, India
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: Show and scroll with Meta-file

Post by Marc Vanzegbroeck »

Thank you, that is what I wanted :)
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Show and scroll with Meta-file

Post by ukoenig »

Marc,

by default :lBmpTransparent := .T.

Using non transparent images like Your drawing
maybe You need

@ 20,20 XIMAGE oImage SOURCE cFile SIZE -20,-20 OF oDlg
oImage:lBmpTransparent := .F.

otherwise it could show something like ( format JPG )
is showing transparent areas on the left upper corner

Image

I tested the mousewheel but there I noticed problems with zoom / unzoom
( it works only sometimes )
moving the image works.

regards
Uwe :D
Last edited by ukoenig on Sat Jul 20, 2019 8:59 am, edited 3 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: Show and scroll with Meta-file

Post by Marc Vanzegbroeck »

Thank you for the info Uwe.
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Show and scroll with Meta-file

Post by nageswaragunupudi »

I tested the mousewheel but there I noticed problems with zoom / unzoom
( it works only sometimes )
Please test again.
It works always.
Make sure the mouse pointer is inside the actual image area.
Regards

G. N. Rao.
Hyderabad, India
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: Show and scroll with Meta-file

Post by Marc Vanzegbroeck »

For me it seems to work always. :)
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Show and scroll with Meta-file

Post by nageswaragunupudi »

Marc Vanzegbroeck wrote:For me it seems to work always. :)
Yes, it does.
Regards

G. N. Rao.
Hyderabad, India
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Show and scroll with Meta-file

Post by ukoenig »

It is working now.
There was a hardware-problem, I didn't noticed before.
After changing the mouse it was ok.

regards
Uwe :oops:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Show and scroll with Meta-file

Post by nageswaragunupudi »

Using non transparent images like Your drawing
maybe You need

@ 20,20 XIMAGE oImage SOURCE cFile SIZE -20,-20 OF oDlg
oImage:lBmpTransparent := .F.

otherwise it could show something like ( format JPG )
is showing transparent areas on the left upper corner
This is not relevant for EMF files.

Using transparency, please see this variation:

Code: Select all

   local oDlg, oImage, oBrush
   local cFile := "NW1151L.emf"

   DEFINE BRUSH oBrush FILE "c:\fwh\bitmaps\backgrnd\stone.bmp"
   DEFINE DIALOG oDlg SIZE 900,600 PIXEL TRUEPIXEL

   @ 20,20 XIMAGE oImage SOURCE cFile SIZE -20,-20 OF oDlg
   oImage:SetBrush( oBrush )

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE BRUSH oBrush
 
Regards

G. N. Rao.
Hyderabad, India
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: Show and scroll with Meta-file

Post by Marc Vanzegbroeck »

Is it also possible to know the location when you do a doubleclick?
Since when you swipe or zoom, the locations are different. Mayme a hyperlink would me nice
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Show and scroll with Meta-file

Post by nageswaragunupudi »

Ok.
Please keep testing and ask all your requirements. We will try to provide them.
Regards

G. N. Rao.
Hyderabad, India
Post Reply