Drawing with 32 bit color?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Drawing with 32 bit color?

Carl Gundel-2
When I specify a CgRGBColor with red, green and blue values the colors seem to distill down to a 16-color palette.  For example the following creates a pixmap and then fills it with a color and then copies it to the clipboard.  The color is a dark red, but it should look more like purple.
 
| window pixmap result |
 window := CgWindow default.
 pixmap := CgPixmap screen: window screen.
 result :=
  pixmap
   compatibleWith: window
   width: 320
   height: 240
   depth: window depth.
 pixmap fill: (CgRGBColor red: 16r9000 green: 16r0000 blue: 16r4000).
 pixmap copyToClipboard
 
By the way, what's the easiest way to view a pixmap in VAST without copying it to the clipboard and opening a paint program?
 
Thanks,
 
-Carl

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Drawing with 32 bit color?

Carl Gundel-2
Any takers on this?  It seems funny to me that in CgPixmap>>compatibleWith:width:height:depth: there is palette related code being invoked in this mechanism when my PC is running 32-bit color.
 
   CommonGraphics imageSupportLoaded
    ifTrue: [self privateSetDefaultPalette]
 
And this code does set a palette with a size of 16.  Is this where the problem lays?  Why should it work this way when a depth of 32 is specified?
 
Thanks,
 
-Carl

On Monday, March 3, 2014 2:45:58 PM UTC-5, Carl Gundel wrote:
When I specify a CgRGBColor with red, green and blue values the colors seem to distill down to a 16-color palette.  For example the following creates a pixmap and then fills it with a color and then copies it to the clipboard.  The color is a dark red, but it should look more like purple.
 
| window pixmap result |
 window := CgWindow default.
 pixmap := CgPixmap screen: window screen.
 result :=
  pixmap
   compatibleWith: window
   width: 320
   height: 240
   depth: window depth.
 pixmap fill: (CgRGBColor red: 16r9000 green: 16r0000 blue: 16r4000).
 pixmap copyToClipboard
 
By the way, what's the easiest way to view a pixmap in VAST without copying it to the clipboard and opening a paint program?
 
Thanks,
 
-Carl

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Drawing with 32 bit color?

Wayne Johnston
Not really related, but this reminded me...

If you try to load a 32-bit color BMP file, you get a walkback.  See how CgWinBMPFileFormat>>loadInfoHeader: and how it handles up to 24-bit.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.