georeference.org
Subscribe to this thread
Home - Scripting / All posts - Put MAP View-Image in VB Form Picture from External Code?
KRahmes4 post(s)
#07-Nov-08 11:51

Using VB.NET and coding "externally," I can't figure out how to get an image (picture, JPEG, PNG, whatever) of the map into a VB Form as the Form.backgroundimage. Obviously this can be done! How?

Here's a snippet of code:

Imports MI = Manifold.Interop

Public Class frmShowManifoldJPEG

Public MApp As MI.Application

Private Sub btnDOIT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDOIT.Click

Dim MDoc As MI.Document

Dim MDocComps As MI.ComponentSet

Dim MTheMap As MI.Map

MApp = CreateObject("Manifold.Application")

MDoc = MApp.DocumentSet.Open("C:\ManifoldProj.map", False)

MDocComps = MDoc.ComponentSet 'What's in the Document?

MTheMap = MDocComps.Item(MDocComps.ItemByName("TheMapName"))

Dim MTheImage As MI.Image

MTheImage = MTheMap.DefaultView '<--- BLOWS UP HERE!

Me.BackgroundImage = MTheImage '<---- THIS WON'T WORK EITHER (Need to convert Image to JPEG?)

End Sub

End Class

KlausDE


3,275 post(s)
#07-Nov-08 12:13

May be there is a way to cast/convert the data in a Manifold image object to an .NET form.backgroundimage. It's probably easier to drop a Manifold ActiveX ComponentControl behind other controls.

KRahmes4 post(s)
#07-Nov-08 15:18

New to the forum so I started another thread.

Probably should have replied here. Oh well!

When I go into my toolbox or object browser, I don't see anything that looks like a Manifold ActiveX control.

It's been awhile since I've used VS, so I may be missing something basic.

How do I find the control and get it into my toolbox?

Do I need to buy it separately from the standard Manifold product?

KlausDE


3,275 post(s)
#07-Nov-08 23:15

There is a collection of the most important postings in Patrick's Manipedia category COM/External programming. If you see newer posts here missing there please add them. It's an indispensable source of information.

Ext.dll is used no longer. Following advice that mention this DLL you have to choose the appropriate new DLL names that lean on the namespace

You can use any machine with Manifold installed and activated to develop and run your programs. Every machine running your stand-alone application using Manifold will need to have a runtime (seperate product 100$/225$ per seat) intallled at least. Or you develop a Web application and have licence on the server only.

dmbrubac


1,399 post(s)
#17-Nov-08 04:52

You could also use mapserver.render if you really wanted an image.


Will Render (for?) Food

0 msec Copyright (C) 2007-2008 Manifold.net. All rights reserved.