473,404 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Declare Auto Function BitBlt Lib "GDI32.DLL" (...)

Hello,

kind of a specific question, but here it goes:

The following code works:

Dim objGraphicsSource As Graphics = PictureBox1.CreateGraphics
Dim bmpSource As New Bitmap(PictureBox1.Width, PictureBox1.Height,
objGraphicsSource)
Dim objGraphicsBmp As Graphics = Graphics.FromImage(bmpSource)
Dim hdcSource As IntPtr = objGraphicsSource.GetHdc
Dim hdcDest As IntPtr = objGraphicsBmp.GetHdc
BitBlt(hdcDest, 0, 0, 50, pbxSource.Height, hdcSource, 0, 0, 13369376)
PictureBox2.Image = bmpSource.Clone()

but when I use as a source an Image object with a bmp loaded from file, it
doesn't work anymore.

WORKS:
Dim objGraphicsSource As Graphics = PictureBox1.CreateGraphics
WORKS NOT:
Dim objGraphicsSource As Graphics = Graphics.FromImage(BmpSource)

Why does this only work with Graphics object based on a PictureBox control
and not with a Graphics object based on a Image object with a bmp loaded
from file?

Thank you.

Declare Auto Function BitBlt Lib "GDI32.DLL" ( _
ByVal hdcDest As IntPtr, _
ByVal nXDest As Integer, _
ByVal nYDest As Integer, _
ByVal nWidth As Integer, _
ByVal nHeight As Integer, _
ByVal hdcSrc As IntPtr, _
ByVal nXSrc As Integer, _
ByVal nYSrc As Integer, _
ByVal dwRop As Int32) As Boolean
Nov 21 '05 #1
0 3003

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Giles Brown | last post by:
I'm feeling quite dumb this morning. I'm trying to build a COM server DLL using py2exe and it ain't working. Here's what ain't working... setup_dll.py based on py2exe sample: """from...
1
by: rotarinn | last post by:
Hi, I am using VisualStudio.NET 2003 trying to connect to an Oracle Database (version 8.0.5). I have created the connection using "Microsoft OleDBProvider for Oracle" and when I click on Test...
4
by: jr | last post by:
I am working in VC++ so this may be microsoft specific though I don't think so. Excuse me if it is. Assuming it isn't, can someone generally explain the purpose of having both - is it purely a...
3
by: Tom Thorpe | last post by:
To all wizards: I have a "C" DLL file already built and running, but I want to have the DLL accessible(callable) from anyway within a LAN and/or WAN( and even multi-WAN's), or even on a PC. I...
0
by: Lewap | last post by:
And exception is ArgumentNullException so I think application don't see "module.dll" file. How to resolve this problem? I must declare this dll, or add to project, or place dll under...
0
by: gbaitsur | last post by:
Hi! I really hope that someone could help me. I have a vb.net application that uses the unmanaged dll, which is part of an independent software. The code is: Declare Sub SUB_NAME Lib...
2
by: Alex Hardin | last post by:
Hey, I just downloaded Visual C++ 2005 Express, and I'm reading through a book called "Visual C++ .NET Step By Step", which was made for 2003. Just so you know where I'm getting this example. ...
13
by: Javad | last post by:
Hello I know that I should get the information of windows internet connections by using "rasapi32.dll" library, and I also have some sample codes, but I can't make them work. My exact need is to...
8
by: Joe HM | last post by:
Hello - I have an Ada *.dll that is called from withing VB.NET. The following works ... Public Declare Sub XXX Lib "X.dll" (ByRef XArgument As XStructure) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.