save a graphic as an image

Posted on 2005-05-09
Last Modified: 2010-05-02

i need to save a graphic and the problem is that the graphic is composed of two picture sets picture1 is where i create the graphic and picture3 i where i draw the scale so i need to save the graphic and the scale as one picture.

So if i use SavePicture Picture1.Image, strsavefile i only get the graphic but not the scale

Any ideas?
Question by:data2002
    LVL 7

    Accepted Solution

    Is Picture3 overlapping Picture1?

    If so, you will need to paint the contents of Picture3 onto Picture1 (using the PaintPicture method or BitBlt API), and then save Picture1.

    Something like this...

        Picture1.PaintPicture Picture3.Image, Picture3.Left, Picture3.Top, Picture3.Width, Picture3.Height, 0, 0, Picture3.Width, Picture3.Height

    ...and then SavePicture.
    LVL 85

    Expert Comment

    by:Mike Tomlinson
    ...or use screen capturing code to get the composite image and then save the capture:

    Microsoft has a great project in their Knowledge Base that does screenshots via API's only...

    The routines in the example can:

    Capture the entire contents of a form.
    Capture the client area of a form.
    Capture the entire screen.
    Capture the active window on the screen.
    Capture any portion of any window given a handle to it.
    Create a Picture object from a bitmap and a palette.
    Print a Picture object as large as possible on the page.

    It can be found here:;en-us;161299&Product=vb6

    Author Comment

    thank you
    LVL 7

    Expert Comment

    Glad to help

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now