Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 PicMerge not working properly
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
SuperGenius




PostPosted: Sat Mar 27, 2004 3:56 pm   Post subject: PicMerge not working properly

I decided to add graphics to my connect 4 game (yes im still working on that) so that it would look more professional. I thought I had it all nice and good, but I don't, and I'm confused. I have one picture which is the game board or grid, and one picutre each of a red and blue checker. I knew that i would have to use PicMerge so that i would not get white corners around the checker. But, using PicMerge causes it to also draw some white "fuzz" around the checker. I also tried PicUnderMerge, but the results were similar. There is actually not even a white background around the source pictures of the checkers.


pics - c4 problem.zip
 Description:
Here is a screenshot of my problem, and the source images I used.

Download
 Filename:  pics - c4 problem.zip
 Filesize:  60.41 KB
 Downloaded:  97 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Sat Mar 27, 2004 4:22 pm   Post subject: (No subject)

Ah, picMerge...very nice.

Ok, here's your problem. You are using JPGs, and if you look carefully enough, white really isn't white. In fact, it's a strange blend of white and other off-white colours.
Thus being, picMerge will not and cannot work to its best form.
This is as it checks for colourbg and considers this transparent.

code:
setscreen ("graphics;nobuttonbar;position:middle;middle")

var pic1, pic2, pic3 : int
pic1 := Pic.FileNew ("board good.jpg")
View.Set ("graphics:" + intstr (Pic.Width (pic1))
    + ";" + intstr (Pic.Height (pic1)))
% Set screen size to correct size.

pic2 := Pic.FileNew ("bluechecker.jpg")
pic3 := Pic.FileNew ("redchecker.jpg")

Pic.Draw (pic1, 0, 0, picMerge)
% Board first, then checker.
Pic.Draw (pic3, 0, 0, picUnderMerge)
% Change x, y, here to draw it in the right place.


Theortetically, this should work.
And it does to some degree. To make it work better though, you will have to either manually edit the pic files to make sure that the white is where it should be, or save them as .bmps (in which such detail is not lost at the expense of increased file size).

So there you have it.
Another problem solved...hopefully.
SuperGenius




PostPosted: Sat Mar 27, 2004 8:38 pm   Post subject: (No subject)

thanks. What i ended up doing was changing the pics to .bmp and putting a hard black edge around the checkers.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: