Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Draw stuff [SOLVED]
Re: Draw stuff [message #13914 is a reply to message #13911] Fri, 01 February 2008 16:44 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I see the problem now. You are trying to draw the image into a Splitter, but the Paint routine is a member of the main window yes? If that is correct then the image is being drawn and then the Splitter is drawn over the top.

What you need to do is add a Ctrl to the Splitter, and have the ctrl draw the Image. You can use ImageCtrl for this, though you may with to roll your own once you have it working.

You don't need the Paint function or MyDraw, just:
// Member variables
ImageCtrl imgctrl;

void LoadImage()
{
  ImageBuffer ib( 128, 128 );

  for( int y = 0; y < 128; y++) {
     RGBA *l = ib[ y ];
     for( int x = 0; x < 128; x++) {
        // in picture[ ][ ] there is the image
        l->a = 255;
        l->r = picture[ y ][ x ];
        l->g = picture[ y ][ x ];
        l->b = picture[ y ][ x ];
        l++;
     }
  }

  imagectrl.SetImage(ib);
}

// And in your window constuctor
..
splitter.Add(imgctrl);
..

PreMultiply is only needed for versions later the 2007.1, but if I were you I would upgrade to the latest dev version and add the call. Dev versions are always very stable and then you won't have to remember to do it later, plus it's been a long time since 2007.1 and there are manby improvements.

[Updated on: Fri, 01 February 2008 18:19]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Optimized storage of 1BPP images
Next Topic: Drawing and scrolling
Goto Forum:
  


Current Time: Thu Aug 21 08:03:27 CEST 2025

Total time taken to generate the page: 0.00794 seconds