Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

save my own picture in file

Posted on 2001-06-11
4
Medium Priority
?
191 Views
Last Modified: 2010-05-02
hi
as you know we can use BitBlt function to get capture from Dc to other Dc.
how i can save the new image whitch i capture it , to the file.
for examp:
Myret=bitblt(picture1.hdc,0,0,100,100,getdc(0),0,0,DropFlag)

when i write

SavePicture Picture1.Picture, "c:\mypic.bmp"

compiler say
thier is no picture

0
Comment
Question by:issamtaher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 38

Accepted Solution

by:
PaulHews earned 300 total points
ID: 6178864
Option Explicit
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long

Private Sub Command1_Click()
    Dim myret As Long
    Picture1.AutoRedraw = True
    myret = BitBlt(Picture1.hDC, 0, 0, 100, 100, GetDC(0), 0, 0, vbSrcCopy)
    Debug.Print myret
    Picture1.Refresh
    SavePicture Picture1.Image, "C:\windows\desktop\test.bmp"
End Sub

0
 
LVL 38

Expert Comment

by:PaulHews
ID: 6178911
The AutoRedraw is the important thing here.  It creates a persistent memory bitmap (necessary for valid picture object) when drawing operations are performed on the DC.
0
 
LVL 1

Author Comment

by:issamtaher
ID: 6178914
thank you for heilping me
yours issam taher
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 6178940
You're welcome
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

618 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