PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > wxruby: paint monochrome bitmaps in other colors
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
wxruby: paint monochrome bitmaps in other colors

Réponse
 
LinkBack Outils de la discussion
Vieux 02/04/2008, 08h14   #1
crystalbrittle@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut wxruby: paint monochrome bitmaps in other colors

Is there an easy way to change the black and white pixels in a
monochrome bitmap to arbitrary color values? I just want to load in a
monochrome gif (or png) and display it in a window with, say, orange
for the black pixels, and yellow for the white... I thought about
swapping the palette of a loaded image file, but I can't seem to
actually create a Palette. But maybe this isn't the best way.

- \/\/
  Réponse avec citation
Vieux 02/04/2008, 09h08   #2
Alex Fenton
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: wxruby: paint monochrome bitmaps in other colors

crystalbrittle@gmail.com wrote:
> Is there an easy way to change the black and white pixels in a
> monochrome bitmap to arbitrary color values? I just want to load in a
> monochrome gif (or png) and display it in a window with, say, orange
> for the black pixels, and yellow for the white


Set the drawing device context's text_foreground and text_background to
be the colours you want, then a mono bitmap will be drawn in those
colours; http://wxruby.rubyforge.org/doc/dc.html#DC_drawbitmap

bitmap.depth = 1
dc.text_foreground = Wx::Colour.new(255, 128, 0)
dc.text_background = Wx::Colour.new(255, 255, 0)
dc.draw_bitmap(bitmap, 0, 0, false)

wxRuby specific questions are usually better posted at
http://rubyforge.org/mailman/listinfo/wxruby-users

alex


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h28.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,06527 seconds with 10 queries