Drawing shapes and saving them

Hello,

I'm looking for a way to draw or drop basic resizable shapes on a form
that could be retrieved once the form is closed and loaded again

Thanks
Avi
0
avi
7/9/2010 5:10:19 PM
vb.general.discussion 1016 articles. 0 followers. Follow

3 Replies
1139 Views

Similar Articles

[PageSpeed] 38

     >   I'm looking for a way to draw or drop basic resizable shapes
     >   on a form  that could be retrieved once the form is closed
     >   and loaded again

Take a look at our MetaDraw component.
           http://www.btis.com/btProducts/MetaDraw/MetaDraw.htm

MetaDraw will allow your users to draw shapes,
move the shapes, and resize the shapes.
You can also save and reload the layout
and continue to select, move and resize the shapes.

To use this, just put MetaDraw and a few buttons on your form.
In each button click you can set the EditMode for user to draw
desired type of shape, or you can set the EditMode to allow
select and resize.        To save and reload the layout just
call the SavePicture and LoadPicture methods.   To print
just set the ExportDC property.


The following is for use with MetaDraw 3 OCX edition
the code for .NET Winforms edition is basically the same but with
different assignments for the constants, and with use of .NET event
structure

            ' - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
             Sub Form_Load()
                ' Initialize drawing area - make it same size as the
control
                With MetaDraw1
                    .ScrollBars =3D BAR_NONE
                    .OrigHeight =3D .ClientHeight
                    .OrigWidth =3D .ClientWidth
                    .PicHeight =3D .ClientHeight
                    .PicWidth =3D .ClientWidth
                    .ZoomFactor =3D 1
                    .ScrollBars =3D BAR_AUTO
                End With
            End Sub
            ' - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
            Sub cmdEllipse_Click()
                MetaDraw1.EditMode =3D ED_ELLIPSE
            End Sub
            ' - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
            Sub CmdRectangle_Click()
                MetaDraw1.EditMode =3D ED_RECT
            End Sub
            ' - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
            Sub cmdPolygon_Click()
                MetaDraw1.EditMode =3D ED_POLYGON
            End Sub
            ' - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
            Sub cmdSelect_Click()
                ' in Select edit mode user can select, move, resize
shapes
                MetaDraw1.EditMode =3D ED_cmdSelect
            End Sub
            ' - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
            Sub cmdSave_Click()
                ' save layout to reloadable format
                FileName =3D "Somefile.mdp"
                SaveFormat =3D PICTYPE_INTENAL
                MetaDraw1.SavePicture  FileName, PIc_Picture,
SaveFormat
            End Sub
            ' - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
            Sub cmdLoad_Click()
                FileName =3D "Somefile.mdp"
                MetaDraw1.LoadPicture  FileName, PIc_Picture
            End Sub
            ' - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
            Sub cmdPrint_Click()
                ' Print the entire layout to user's choice of printer
                MetaDraw1.Current =3D OBJ_CONT_MAIN
                MetaDraw1.ExportDC =3D -2
            End Sub
            ' - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -

You can try this out in your web browser at
          http://www.btis.com/btproducts/MetaDraw/WebSamples/Drawing/md3_de=
mo.htm
You can also download MetaDraw to try in your own application
          http://www.bennet-tec.com/downloads.htm
I hope this is helpful


* * Please include a copy of this message with any reply on this topic


        Jeff Bennett
        Jeff   / At /   Bennet-Tec   /  DOT  / Com


        *    Bennet-Tec Information Systems, Inc
        *    50 Jericho Tpk, Jericho, NY 11753
        *    WWW.Bennet-Tec.Com

	RELIABLE Component Software
	and Custom Software Development Services

        *    Expert Systems     *   Text Processing
        *    Databases       *  Interactive Web Sites
        *    Diagramming,  Drawing,  Hotspot Graphics
        *    Data Input & Data Presentation Systems
        *    Decision Support         *    Web Based Data Collection
        *    Forecasting         * Signature Capture
        *    Desktop Windows,  Tablets,   Pocket PCs


             TList=99   /   ALLText=99  /  MetaDraw=99  /  Web Signature=99

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D   =
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

0
BTIS
7/10/2010 11:35:35 AM
   That's a very general question. It's not the
sort of thing that people can just post a few
lines of code for. You might start by looking
at vbacccelerator.com. I think they have sample
programs that demostrate drawing techniques.

   I did something like that once for a scripting
component that can draw on the Desktop and
optionally save the drawing. I don't know whether
it's quite what you want, but if it looks useful
I'd be happy to send you the relevant code from
that project:

http://www.jsware.net\jsware\jsdraw.php5

  The component comes with sample VBScripts
that demonstrate how it works.

   Another thought: You want people to be able
to create and resize shapes by dragging, etc.?
Then you want to reopen the program with the
shpaes from last session? Couldn't you do that
by just using VB Shape controls and keeping
a record of the resize operations?


|
| I'm looking for a way to draw or drop basic resizable shapes on a form
| that could be retrieved once the form is closed and loaded again
|
| Thanks
| Avi 


0
Mayayana
7/10/2010 1:47:34 PM
"avi" <aviben@bezeqint.net.il> wrote in message 
news:9ea9e00c-3c2e-4610-8207-77ffc96fb8ad@d37g2000yqm.googlegroups.com...

> Hello, I'm looking for a way to draw or drop basic resizable
> shapes on a form that could be retrieved once the form is
> closed and loaded again

Hi Jeff.

Mike



0
Mike
7/12/2010 6:14:12 PM
Reply:

Similar Artilces:

Saving web form fields in Access DB
Today, if a customer completes a web-based form for training, the form information is submitted via an email to an outlook mailbox. We would like to develop a macro that parses this outlook email content to a Microsoft Access Database. How would one go about this? uh pick up a copy of DreamWeaver and move to SQL Server "sunflower" <sunflower@discussions.microsoft.com> wrote in message news:07B4313C-73E7-4A7F-B65C-6778F72A02DF@microsoft.com... > Today, if a customer completes a web-based form for training, the form > information is submitted via an email to an ou...

Saving a chart as a picture file
Hi everyone. It is possible to save a chart as a picture (*.gif, *.jpg, etc.)? What I've been doing so far is saving the file as a web page, opening the page in internet explorer and then saving the chart as a picture file. However, when I do this the chart is not saved as a large file - this method is also too time consuming, since I am dealing with 70+ charts. Thanks for any help. Fred. I think he wants Walkenbach's chart tools: http://www.j-walk.com/ss/excel/files/charttools.htm Jon Peltier wrote: > Fred - > > You want VBA's Chart.Export method. Here's...

Gray status boxes -- saving, repagination, ""
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Today I started getting gray rectangular &quot;status boxes&quot; any time I pasted a word. The &quot;Edit&quot; in the Menu would flash every time I pasted a word (Command-v). Then the &quot;status box&quot; would have a horizontal line fill from left to right. <br><br>This new development also has the same type of box for indicating that Word is checking for smart quotes or repaginating a 100 page document. When the show codes option is turned on, the &quot;status box&qu...

"save" button not requerying as coded
Using Access 2007 I have a form (frmNewFamily) that is opened when a NotInList event is triggered from a subform in a different form (frmAttendance/sfrAttendee). I have a "Save" button on the frmNewFamily that will save the record, close the frmNewFamily and requery the combo boxes on sfrAttendee. I have it working just great, but I want to delete one of the combo boxes. But as soon as I comment out the requery line, the Save button stops functioning properly. It will save the record to the table, but not close the form or requery the combo box. The same thing...

why is colour in shapes or background not visible until print pre.
When creating a shape or adding a background to a document in publisher 2003, the colour or background is not visible until you go to print preview. This happens on a friends PC but I can't reproduce it. He was told to upgrade the ram on his graphics card which he did, but that made no difference. He can put photographs and coloured text or clipart and view it - just not colour in shapes or backgrounds. Other applications do not have this problem. Upgrading the RAM isn't going to help if the driver is outdated. Have your friend slide the acceleration down on his adapter, control ...

Check if a form has changed since it was last saved
I am developing an application using an ms access front end and a visual foxpro 8 backend. The application uses adodb connections to add/ update/edit data in the back end database. When a user clicks the save button on main data capture form the user input is programmatically inserted into a new record or an existing record is updated by creating SQL INSERT INTO or UPDATE statements on the fly. I was wondering if anyone knew of an efficient way of coding a mechanism to check if the form had changed since the save button was last pressed. I guess this can be achieved by capturing the On Chan...

Save As #7
I am running Microsoft Excel 2003, however I've had the same problem since running Excel 2000. Whenever I go to save an excel spreadsheet for the first time, more than 3 directories down, I get the error: "The file cannot be accessed try the following:" followed by a list of options to try, none of which work. Is there a limitation on the length of the directory name recognized in Excel. I don't have this problem with any of my other Microsoft Office applications, solely Excel. Please HELP. P.S. I can move the file to the directory after saving it two or three ...

Can I save my toolbar
In Word I can save the normal template so on reformatting I have all my personal toolbars/ cutomisations. Is there anything similar I can do with Excel. Thanks in anticipation Ken When you exit Excel the current menu and toolbar setup is always saved (to your XLB file). And it will be restored from the XLB file when you start Excel. If this doesn't help perhaps you can elaborate. -- Jim Rech Excel MVP "Ken" <noone@nowhere> wrote in message news:420b1b44$0$4097$db0fefd9@news.zen.co.uk... | In Word I can save the normal template so on reformatting I have all my...

changing directory in which Outlook saves attachments
Hi! Is it possible to change the folder/directory in which Outlook 2002 saves attachments and from which you get files to send as attachment? If yes, how? Thanks for your attention, Andre Laarakker Hello Andre Laarakker, you wrote on Wed, 24 Aug 2005 21:43:16 +0200: > Is it possible to change the folder/directory in which Outlook 2002 > saves attachments and from which you get files to send as attachment? > If yes, how? I am not sure, if [1] works in Outlook 2002 too. If not, please do what in [2] is described. [1] http://support.microsoft.com/default.aspx?scid=kb;en-us;25273...

Asking to save for new entries thorugh SDK
I'm uploading some invoices through a program in c#, but when the user opens the invoice, it asks to save it. Once you do it, it doesn't ask again. I was looking at the record in the InvoiceBase table and looks like the record was not changed. The fields that I use in the invoice are: + name + description + customerid + ownerid and other custom fields. Any idea if any other field must be initialized. It happens the same with the invoice detail, for it I upload: +description + productdescription + actualdeliveryon + quantity + priceperunit (equals 0) + ispriceoverridden (equals 1...

printing the saved date/time
is the a field code or something to print the save date in a footer i.e there is a field code for the current date in excel &[date], but i would like it to be the last date it was saved thanks in advance!!! You need VBA to do this If you copy this in the ThisWorkbook module it will print the Last Save Time in the RightFooter of every sheet you print Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wkSht As Worksheet For Each wkSht In ThisWorkbook.Worksheets wkSht.PageSetup.RightFooter = "&8Last Saved : " & _ ActiveWorkbook.BuiltinDoc...

Allowing and Saving Data in Form Fields
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have created a Word document with form fields that is password protected. When I saved the document, I selected &quot;Track Forms&quot;. However, my recipient is unable to save the data they input into the form field. How do I allow this? I am not quite sure what you are doing, because your terminology does not exactly match what I see in Word. I suspect the issue is that the document must be protected for forms to enable the form fields. If the document is not protected for forms, the user cann...

What, Why three areas to save code
Hi My questions relate to the "Why", "Where" and "What" type of macro code should be stored in (I believe 3 places) that Excel has. 1. in the worksheet. 2. in a module/s. 3. in the Personal.xls. I understand the reasons for the No.3. Personal.xls is opened but hidden at Excel Start-up. This allows the user to add a command button to a toolbar to carry out a specific task on any workbook opened and call up any procedure within Personal.xls. Could someone explain the "Why", "Where" and "What" of the other two places; What was e...

Denying local saves of spreadsheets...
I have a question on the possibility of denying a server residing spreadsheet from being saved on a client computer. While the data in ? has been write potected, and, therefore, altered versions cannot be sent back to the server from a user, I am wondering if there is some way (Perhaps an Excel Macro?) to deny the user saving this spreadsheet to his machine. I welcome any help on this matter, and thank you in advance. In article <E8A6111D-5956-4B5F-9F97-C3B92CD9B97A@microsoft.com>, proy4 @csc.com says... > I have a question on the possibility of denying a server residing spread...

Unofficial Daylight Saving Time Workaround for Entourage X
Office 2004 was updated for the DST changes (11.3.3) however, Office X will not be updated by Microsoft. Officially, Office X has reached the end of it's life-cycle. Support for Entourage X ended January 9, 2007. A workaround for the DST change has been provided by a group of anonymous contributors in the Entourage Mac community for Entourage X. It is provided "as is" with no warranties or support. <http://www.entourage.mvps.org/articles/unofficial_dst_workaround.html> This is a workaround not a fix. Any questions about using the workaround should be addressed on the mi...

saving ppt file with animation- excel graph animated by series
I have an ppt file that has excel graph copied in the slide. I have created an animation using the custom animation by series. This enables me to animate each series of plotted data in the graph. The problem is that I only need 3 of the 6 series to be animated. I remove the other three series from the animation pane and I preview the results and everything is perfect. The three series of data that I need animated are in fact animated. When I save the file, it reverts back to animating all six series of plotted data. Is there a different way of saving a file with animation that I ...

.tif high res save?
I am baffeled as to how i may save my created bussiness card to a 300 dpi .tif . It will save as a 96 dpi by default. but my printing company said it comes out too grainy due to the low Res. My printer works for half the cost of every one else if i give him the file as a .tif this is very discuraging to not be able to use what i have worked so hard on. any help will be nice, thanks hans A small child turns to Ed, and exclaims: "Look! Look! A post from anonymous@discussions.microsoft.com <anonymous@discussions.microsoft.com>!"... > I am baffeled as to how i may save...

"Save As" function issues
Every time I try to use the "Save As" function in Microsoft Word, my PC tries to open a completely unrelated program (AutoManager WorkFlow 6.1 - by Cyco software). I am running Microsoft Office Word 2007 (12.0.6504.5000) SP2 MSO (12.0.6514.5000) on Windows Vista Enterprise (Service Pack 2). Is this most likely an issue with the settings in Microsoft Word, or in the AutoManager Workflow program? Are you accessing Save As with a keyboard shortcut (presumably one you assigned to it)? If so, it may be being overridden by a different assignment to that combination in Windo...

Visio 2003: How do you resize a shape that has been imported?
I am using the import method of a page object. I am successfully importing a .WMF file into my drawing. However, with Visio 2003, the image that imports into Visio 2003 is much bigger than the drawing page. When I am executing the same code with Visio Standard 5c instead, the imported image automatically resizes to the drawing page. I have tried to use the ResizeToFitContents method but this seems to make the drawing page fit the image. But, I need the image to scale down to the drawing page. Does anyone have any ideas? Here is a sample of my VB code. '******************************...

How can you draw a shape when the values change each time??
See example with worksheet Change event proc: http://cjoint.com/?erkFfzkxwN HTH -- AP '-------------- Private Sub Worksheet_Change(ByVal Target As Range) If Intersect( _ Target, _ Union( _ Range("Center_X"), _ Range("Center_Y"), _ Range("Radius") _ ) _ ) Is Nothing Then Exit Sub With Me.Shapes("Circle1") .Top = Range("Center_Y").Value - Range("Radius").Value .Left = Range("Center_X").Value - Range("Radius").Value .Height = 2 * Range("Radius")...

Resource File does save WideChar ?
Hi: I'm testing with a small windows program using VC7.1. I have inserted a new string table and set the language to "Chinese (PRC)". I also entered some Chinese characters in the string table using IME. But the string table shows those Chinese chars as "?" What should I do so that the string table stores the Chinese chars? I tried to define the UNICODE, but it did not make difference. Thanks in Advance. Polaris I've never done this, but there is an issue between what it "shows" and what it actually contains. What do you find in the .rc file? ...

Turn off "alerts" to save/delete tables
Hi, I am trying to run a Macro that runs 3 queries. In the process tables are being deleted/created and there are a lot of prompts to save/delete etc... I just want to turn these off. I got some advice but was having a few issues implementing them. Here is where I am so far. In the Macro - I tried to turn off the alerts at the beginning and then turn them on again. OpenModule: OpenQuery: OpenQuery: OpenQuery: OpenModule: End of macro... In OpenModule: ModuleName = Module1 Procedure = SetOff In Module1 I have ////////////////////////////////////////////////////// Option Compare Da...

Save ReadOnly file
I have following problem: File is open as readonly. Some changes in this workbook are made. Ho can I close this changed workbook using VBA if I wouldn�t save thi workbook as copy of original workbook? Activeworkbook.close savechanges = false - didn�t work Any idea? Version: Excel 2000 Please hel -- Message posted from http://www.ExcelForum.com Is this a typo in the post or in your code: Activeworkbook.close savechanges = false Should look like this (notice the colon) Activeworkbook.close savechanges:=false If it was a typo in the post, what kind of error do you get. (I've...

READING SAVED BAND E MAIL?
I am trying to figure out how I can re read E Mail sent to me by my bank that was already read and saved in Money 2003? Thanks, Arty On Fri, 09 Jan 2004 20:09:54 GMT, ART SANTELLA <santella@optonline.net> wrote: >I am trying to figure out how I can re read E Mail sent to me by my bank that was >already read and saved in Money 2003? >Thanks, > >Arty Thanks, Arty ...

CListCtrl w/ LVS_OWNERDRAWFIXED
I have an owner drawn CListCtrl with LVS_REPORT style. I want to draw my own thing in one of the columns only. The rest of the columns I'd like to appear just as if the CListCtrl was not owner-drawn. What's the easiest way to accomplish this? The code I have from http://codeguru.earthweb.com/listview/sel_row.shtml includes code to draw standard text in the same style as the standard list control, but if possible I'd like to remove that and just have the standard list control process the drawing of the other columns. Thanks, David http://www.dcsoft.com "David Chin...