Show and scroll with Meta-file

Show and scroll with Meta-file

Postby Marc Vanzegbroeck » Fri Jul 19, 2019 4:23 pm

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
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Show and scroll with Meta-file

Postby nageswaragunupudi » Fri Jul 19, 2019 5:47 pm

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: 10254
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Show and scroll with Meta-file

Postby nageswaragunupudi » Fri Jul 19, 2019 6:19 pm

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

Code: Select all  Expand view
  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
User avatar
nageswaragunupudi
 
Posts: 10254
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Show and scroll with Meta-file

Postby Marc Vanzegbroeck » Fri Jul 19, 2019 7:50 pm

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

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Show and scroll with Meta-file

Postby ukoenig » Sat Jul 20, 2019 8:50 am

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Show and scroll with Meta-file

Postby Marc Vanzegbroeck » Sat Jul 20, 2019 8:55 am

Thank you for the info Uwe.
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Show and scroll with Meta-file

Postby nageswaragunupudi » Sat Jul 20, 2019 9:12 am

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
User avatar
nageswaragunupudi
 
Posts: 10254
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Show and scroll with Meta-file

Postby Marc Vanzegbroeck » Sat Jul 20, 2019 9:20 am

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

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Show and scroll with Meta-file

Postby nageswaragunupudi » Sat Jul 20, 2019 9:51 am

Marc Vanzegbroeck wrote:For me it seems to work always. :)


Yes, it does.
Regards

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

Re: Show and scroll with Meta-file

Postby ukoenig » Sat Jul 20, 2019 10:38 am

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Show and scroll with Meta-file

Postby nageswaragunupudi » Sat Jul 20, 2019 1:08 pm

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  Expand view
  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
User avatar
nageswaragunupudi
 
Posts: 10254
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Show and scroll with Meta-file

Postby Marc Vanzegbroeck » Sat Jul 20, 2019 1:14 pm

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
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Show and scroll with Meta-file

Postby nageswaragunupudi » Sat Jul 20, 2019 1:23 pm

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

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 14 guests