Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

General BitBlt question in VB

Posted on 2004-04-06
10
Medium Priority
?
237 Views
Last Modified: 2012-06-21
I have been experimenting with the BitBlt command in VB and can't seem to get the results that I want. What I want to do is load a picture in one picturebox and copy it over to another picturebox utilizing stretch or transparent modes. I can get this to work ONLY if both pictureboxes are visible on the screen, which is not what I want. I want the source hidden either not visible or off the screen. How can I get this to work? As a side note, I am using eVB which has very limited picturebox commands. It does not support LoadPicture which I know is an alternate way of getting what I want in VB6.

Can someone explain why the source picturebox must be visible on the screen for BitBlt to work? I thought it was just copying a memory map from one object to another, so why does it have to be visible? Does anyone have a solution for what I want?
0
Comment
Question by:patricksd
[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
10 Comments
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 10768149
Try set the target picturebox's AutoRedraw Property to True?

like:

Picture2.AutoRedraw = True
0
 
LVL 4

Expert Comment

by:AndyAmess
ID: 10768210
I had a few problems with eVB and picture box so I switched to this freeware control and find it much better. It also has ability to use other formats and is much more fun to use.

http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/prog/s309pict.html

A. ;-)
0
 

Author Comment

by:patricksd
ID: 10768547
Regarding Autoredraw, eVB does not support that feature. I had already tried the S309 control but found it to be too slow for loading many transparent .gifs  at a large screen resolution. Somehow the transparency bogs it down. Using the API TransparentImage seems to work much faster, but the problem is the source picturebox must be visible on the screen for it to work. Plus it seems that when another event happens, the destination picturebox loses the changes. So either way, I am not happy with BitBlt that everyone recommends using, unless I am using it wrong. If anything, I want to understand what is going on.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Expert Comment

by:frankd
ID: 10768713
Just a suggestion, try setting the zorder such that both picture box's are visible but one is behind the other.

Frank
0
 

Author Comment

by:patricksd
ID: 10769301
Zorder doesn't help. It appears to rely on the screen image for data as opposed to the data stored in the picturebox. Perhaps they are one in the same?
0
 
LVL 17

Expert Comment

by:zzzzzooc
ID: 10781097
Set Picture2.Picture = Picture1.Picture

Does eVB atleast support that? :-)

Concerning copying DCs of hidden windows..
http://www.fengyuan.com/article/wmprint.html
0
 
LVL 17

Expert Comment

by:zzzzzooc
ID: 10781116
To comment on what I mentioned about (Set Picture2.Picture = Picture1.Picture)..

If the above works, you'll have the hidden picture in the visible PictureBox. Then you may be able to use that as a source and destination for BitBlt. If not, you can try creating a memory-dc, applying the stretch/transparency to that, then bitblt'ing it back to the visible portion.

Additionally, check out: http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20944169.html

You can possibly use the same method in the above to get the bits of the picture, modify them and then repaint them to the destination picturebox.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11441252
PAQed - no points refunded (of 500)

modulo
Community Support Moderator
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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 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…
Suggested Courses

704 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