fast overlay display
fast overlay display
Hello,
i am reactiving this subject
[Link to the old forum deleted]
because i didnt have any feedback.
When we do have a scene, or lets say a background zoomable .jpg picture, and we want to add dynamically element on this map (icons, or small jpg), do we have to redraw the whole scene+objects, or is there a way of recomputing only the changes ?
problem is that when backround picture is big, redisplaying the whole stuff leads to clipping,
Thanks
i am reactiving this subject
[Link to the old forum deleted]
because i didnt have any feedback.
When we do have a scene, or lets say a background zoomable .jpg picture, and we want to add dynamically element on this map (icons, or small jpg), do we have to redraw the whole scene+objects, or is there a way of recomputing only the changes ?
problem is that when backround picture is big, redisplaying the whole stuff leads to clipping,
Thanks
Hi,
If I understand what you want to do is to dispay a large image file with the gdviewer object and to display over it other smallest pictures/images ?
You can do that easily:
- Catch the Displayed() event of the GdViewer object.
- Use a cGdPicture object to draw image on HDC: DisplayImageOnHDC() method
vb6 sample code:
You can download this demo project from here:
https://www.gdpicture.com/ressources/support/overlay.zip
Best regards,
Loïc Carrère
If I understand what you want to do is to dispay a large image file with the gdviewer object and to display over it other smallest pictures/images ?
You can do that easily:
- Catch the Displayed() event of the GdViewer object.
- Use a cGdPicture object to draw image on HDC: DisplayImageOnHDC() method
vb6 sample code:
Code: Select all
Dim oGdPicture As New GdpicturePro.cGdPicture
Dim nIcoHandle As Long
Private Sub Command1_Click()
oGdViewer.DisplayFromFile (Text2.Text)
End Sub
Private Sub Form_Load()
oGdViewer.SetLicenceNumber ("0012345678910111213141516") 'Demo code version
nIcoHandle = oGdPicture.CreateImageFromFile("icon.ico")
End Sub
Private Sub oGdViewer_Displayed()
Call oGdPicture.SetNativeImage(nIcoHandle)
Call oGdPicture.DisplayImageOnHDC(oGdViewer.hDC, 1, 1, 100, 100)
End Sub
You can download this demo project from here:
https://www.gdpicture.com/ressources/support/overlay.zip
Best regards,
Loïc Carrère
i mean, if i display an ico using the DisplayImageOnHDC(),
then zoom in the whole scene using the mouse, will the ico be zoomed in as well ?
actually maybe if i capture the ZoomChanged event and call gdObject.Resize() to match the new zoom it will do it ?
i need to place lot of object on the map and move them around, i need them to be zoomable (to follow the main map scale)
then zoom in the whole scene using the mouse, will the ico be zoomed in as well ?
actually maybe if i capture the ZoomChanged event and call gdObject.Resize() to match the new zoom it will do it ?
i need to place lot of object on the map and move them around, i need them to be zoomable (to follow the main map scale)
actually, how can i remove the gdobject from the viewver once it has beeen placed using DisplayOnHDC() ??
You have just to call the Refresh() method of the gdviewer control and don't call thes lines:
Code: Select all
Call oGdPicture.SetNativeImage(nIcoHandle)
Call oGdPicture.DisplayImageOnHDC(oGdViewer.hDC, 1, 1, 100, 100)
Code: Select all
Dim bWantDisplayItems As Boolean 'Public Var
bWantDisplayItems = False
Call oGdViewer.Refresh()
bWantDisplayItems = True
Private Sub oGdViewer_Displayed()
If bWantDisplayItems Then
Call oGdPicture.SetNativeImage(nIcoHandle)
Call oGdPicture.DisplayImageOnHDC(oGdViewer.hDC, 1, 1, 100, 100)
End If
End Sub
Who is online
Users browsing this forum: No registered users and 2 guests