Y'herd thisun? 

“Falcon One is going to be the lowest cost per flight to orbit of any production rocket. Which means we’re cheaper than the Chinese, cheaper than [the] Russians or anywhere else – and we’re doing it in the United States with American labour costs.”
-Elon Musk

Your own image control and App part 22

TaggedCoding, VB, Imaging

Originally published December 2002 on using VB7.0/2002. Updated for VB7.1 February 2005

Links for compiled demo versions, all required resources and source code are included at the end of this article.

Plus, get the complete eBook in Adobe Acrobat 7 format ... all here.

22) Adding ImageEditors

Select the toolbox icon for the svImageEditor control and draw an instance near the bottom of the pnlSource, leaving room between it and the toolbar. Select the svImageEditor control and in the property sheet set the Name to "svImageSource" and the MouseMode to "AutoScroll" which will be our default mode.

To position the editor, set the Dock property to "Bottom", this will fill in the lower area of the panel. Now carefully drag the top edge of the editor up to nearly touch the bottom edge of the toolbar. Click away from the controls to check the placement and when it's pretty snug without overlapping select the editor and in the property sheet set the Anchor toAll Sides (leave the Dock set to Bottom).

Save the solution. F5 to test that the controls are all resizing correctly when you slide the splitter and resize the form.

Now do the same steps with an svImageEditor on the Result panel (setting this one's Name to "svImageResult"). F5 to test.

Next: A flat/popup/multicolored toolbar zoomcombo

Robert Smith
Kirkland, WA

added to smithvoice march 2005

jump to:

  • 1) The spec
  • 2) Setting up the workspace
  • 3) Feature 1: Loading an image
  • 4) Custom Exceptions
  • 5) "Fax images" and Multipage TIFFs
  • 6) Custom events
  • 7) Selecting specific fax pages
  • 8) Feature 2: Rotating image displays
  • 9) The most useful tool in GDI+: DrawImage
  • 10) Feature 3: Zooming
  • 11) Handling the unhandleable exception
  • 12) Fixing the squish
  • 13) Zooming to fit the control
  • 14) You're already beating the Pros
  • 15) Feature 4: Cropping
  • 16) Bonus Feature: StickyMouse
  • 17a) Final Cleanup
  • 17b) Passing the current display image
  • 18) Making the application
  • 19) Source and result viewports
  • 20) A better toolbar
  • 21) Hooking the toolbar to the project
  • 22) Adding ImageEditors
  • 23) The toolbar ZoomCombo
  • 24) The final solution
  • 25) Saving to image files
  • 26) An integer-only textbox
  • 27) Passing save options between forms
  • 28) Dealing with that last exception
  • 29) Offer more options with menus
  • 30 The downloads and ebook

  • home     who is smith    contact smith     rss feed π
    Since 1997 a place for my stuff, and it if helps you too then all the better