MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking
Go Back  Xtreme Visual Basic Talk > > > MSG to OnError: Help with programmatic masking


Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2008, 10:27 AM
gayouj's Avatar
gayoujMSG to OnError: Help with programmatic masking gayouj is offline
Junior Contributor

* Expert *
 
Join Date: Jan 2006
Location: California
Posts: 317
Default MSG to OnError: Help with programmatic masking


This message is directed to OnError because it has to do with a tutorial he wrote but input is always welcome from the rest of the very talented people here as well.

So I'm using your programmatic masking demo as the foundation for a graphics engine for sprite-based games. Instead of having all the functionality in one class, though, I've broken it out so that all the functions related to just loading the image and image processing are in a class called CImage. All the functions involved in painting the image to the display are in a class called CBlitter.

I want the CImage class to have two modes: standard and transparent. Transparent works just fine because it's more or less a direct port of your code. Standard is giving me some trouble, though. I've tried to put conditions in your existing code in order to try and only go so far if the image is not transparent but the best I can do is to display an image that's faded and has funky colors. I've tried looking through the AllAPI documentation but I just don't know enough about GDI yet to understand where I'm screwing up (will need to buy a book, here eventually). What I've settled for right now is to just define the transparent color as magenta if the color is not supplied for now, but I know at some point I'm going to come accross an image that has that color in it at some point. Any consideration you could give this is greatly appreciated.

The code for my classes is attached. Also, if anyone thinks that this code might be useful, you're more than welcom to lift it for your project.
Attached Files
File Type: zip CImage.zip (2.9 KB, 7 views)
__________________
http://www.joshuagayou.com
Reply With Quote
  #2  
Old 04-20-2008, 08:23 PM
passel's Avatar
passelMSG to OnError: Help with programmatic masking passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,026
Default

My guess is that if you want to do a "standard" bitblt, then you would only want to do a single bitblt with a Raster Operation of vbSrcCopy, instead of the two bitblts with raster operations of vbSrcAnd and vbSrcPaint.
More specifically, copy the bitblt with vbSrcPaint in it, and change the rasterOP to vbSrcCopy.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
  #3  
Old 04-21-2008, 10:18 AM
gayouj's Avatar
gayoujMSG to OnError: Help with programmatic masking gayouj is offline
Junior Contributor

* Expert *
 
Join Date: Jan 2006
Location: California
Posts: 317
Default

Quote:
Originally Posted by passel View Post
My guess is that if you want to do a "standard" bitblt, then you would only want to do a single bitblt with a Raster Operation of vbSrcCopy, instead of the two bitblts with raster operations of vbSrcAnd and vbSrcPaint.
More specifically, copy the bitblt with vbSrcPaint in it, and change the rasterOP to vbSrcCopy.



Well, of course you use a vbSrcCopy! Who the hell would ever try to do anything different?!?!



Thanks for the slap upside the head. I'll let you guys know the next time I feel like wasting someone's time...
__________________
http://www.joshuagayou.com
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking
 
MSG to OnError: Help with programmatic masking
MSG to OnError: Help with programmatic masking
 
-->