Skip to main content
Hi all,

Is it simply possible to have just a static image (.jpg ?) of the viewflow ? Because we can't depoly the framework on every pcs, and we just want users see an image of the viewflow in a web application.

Thanks,

Aude
Hi Aude,

I think you are looking for this KB article:

KB000023 - Reuse K2.net 2003 ViewFlow component.

Graham
Hi Graham,

thanks for your help, but the problem with this method is that the framework must be install on the users pcs, and we can't ! but users want to see the viewflow ...So I just want an image, not the activeX viewFlow, just a jpeg or something like that, is that possible ??
I've a look on the dll but nothing help ...

Aude
Hi Aude,

There isn't any direct support for this in the DLL as far as I know. However, I have created a proof-of-concept that renders the viewflow to an image that can then be saved and distributed via normal http methods.

The basic premise is to call the OnPaint sub of the ViewFlow component, but with a graphics object that relates to an image, rather than a control surface.

The extremely simple version of this code is as follows:

Public Class NewViewControl
Inherits ViewProcessInstance.ViewControl

Public Shadows Sub OnPaint(ByVal e As PaintEventArgs)
Dim _random As New Random
Dim _filename As String = "c: est" & _random.Next & ".bmp"
Dim _image As New Bitmap(1000, 1000)
Dim _e As New PaintEventArgs(Graphics.FromImage(_image), e.ClipRectangle)
MyBase.OnPaint(_e)
_image.Save(_filename)
End Sub

End Class


Now obviously I was just creating a fixed sized bitmap and saving it to disk, but with some work this could become a solution for the web. You could implement this as an httphandler so it returns a image stream directly over http without ever writing the image to disk.

I could offer you some more pointers if you need a hand.

Thanks.

Adam.

Hi Adam, Do you have any C# sample for this requirement? I need it. Thanks.


 Pochien


Hi Adam,


Here is my C# Control Inhert ViewProcessInstnace.ViewControl.


public partial class ViewFlowchart : ViewProcessInstance.ViewControl { Random random = new Random(); string filename = ""; Image img = new Bitmap(1000, 1000); PaintEventArgs _e; public ViewFlowchart() { //InitializeComponent(); } protected override void OnPaint(PaintEventArgs e) { // Call the OnPaint method of the base class. base.OnPaint(e); // Call methods of the System.Drawing.Graphics object. filename = "c: emp_" + random.Next() + ".bmp"; _e = new PaintEventArgs(Graphics.FromImage(img), e.ClipRectangle); base.OnPaint(_e); //e.Graphics.DrawString(Text, Font, new SolidBrush(ForeColor), ClientRectangle); img.Save(filename); }


 But I got some problem when use it in the viewflow sample.


1. Cannot find resource about "Icons.Activity.ico.


2. It create many BPM image files, when I triger to show flowchart in a panel.


 


Reply