Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > VB Classic

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 04-04-2002, 06:57 PM
Ander
Guest
 
Posts: n/a
Combining graphics...?


Hi,

Greetings from Canada (just like the Subject said).

You guys seem to know a lot about VB. I've checked all the books and sites
I could---and even asked a few "experts"---but no one seems to know how to
do this...

I'm writing a program to make chess diagrams for webpages. I have a chess
font, and all I want to do is create a GIF of a diagram composed from the
various characters.

I have a control that converts a picture box's contents to a GIF, so that's
no problem. I just can't figure out how to combine the chess characters with
a background color in one picture box.

If I just set the picture box's background color, it shows through the unfilled
parts of the text characters, too.

The chess font does contain a set of black outlines for each piece---so if
I could combine a piece character with an outline character, I could control
both of their colors with no problem. But how can I print two characters
(or images, if I print them to separate picture boxes first) to the _same
area_ of a picture box, without one wiping out the other?

Alternately, is there a non-crazy way to print the chess-piece characters
(or their images) to a picture box, then fill in the colors of the squares
around them---without disturbing the "pieces" themselves?

Thanks for your help!


Reply With Quote
  #2  
Old 04-04-2002, 07:44 PM
Mike D Sutton
Guest
 
Posts: n/a
Re: Combining graphics...?

> Greetings from Canada (just like the Subject said).
>
> You guys seem to know a lot about VB. I've checked all the books and sites
> I could---and even asked a few "experts"---but no one seems to know how to
> do this...
>
> I'm writing a program to make chess diagrams for webpages. I have a chess
> font, and all I want to do is create a GIF of a diagram composed from the
> various characters.
>
> I have a control that converts a picture box's contents to a GIF, so

that's
> no problem. I just can't figure out how to combine the chess characters

with
> a background color in one picture box.
>
> If I just set the picture box's background color, it shows through the

unfilled
> parts of the text characters, too.
>
> The chess font does contain a set of black outlines for each piece---so if
> I could combine a piece character with an outline character, I could

control
> both of their colors with no problem. But how can I print two characters
> (or images, if I print them to separate picture boxes first) to the _same
> area_ of a picture box, without one wiping out the other?
>
> Alternately, is there a non-crazy way to print the chess-piece characters
> (or their images) to a picture box, then fill in the colors of the squares
> around them---without disturbing the "pieces" themselves?


Just put the chess board background as the background to your picture box
and use the Print() method or TextOut()/DrawText()/ExtTextOut() API's to
draw the text (In the chess font) onto the picture box. Enable the
AutoRedraw property before doing so though so you don't loose anything
you've already drawn. Alternatively render the chess font out to a bitmap
and use transparent blitting to draw each piece into it's place on the
picture box, you'll find a transparent blitting library on my page that will
do this for you and plenty of sample code (Animated transparent blit demo
for example)
Hope this helps,

Mike


-- EDais --

- Microsoft Visual Basic MVP -
WWW: Http://EDais.earlsoft.co.uk/
Work E-Mail: EDais@btclick.com
Other E-Mail: Mike.Sutton@btclick.com


Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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


All times are GMT -4. The time now is 10:08 PM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.