Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!udel!haven!mimsy!mojo!russotto From: russotto@eng.umd.edu (Matthew T. Russotto) Newsgroups: comp.sys.mac.programmer Subject: Re: Quick drawing Message-ID: <1990Dec16.161757.3018@eng.umd.edu> Date: 16 Dec 90 16:17:57 GMT References: Sender: news@eng.umd.edu (C-News) Organization: College of Engineering, Maryversity of Uniland, College Park Lines: 34 In article aberno@questor.wimsey.bc.ca (Anthony Berno) writes: > >First, I am trying to get a really fast way of doing 2-d color histograms. >This, of course, involves drawing LOTS of little color rectangles on the >screen. When drawing a little 2x2 rectangle, there are many ways of >doing it. You can use FrameRect, PaintRect, use a pen, etc. But what is >the fastest? Try it a few different ways and see-- I tend to suspect the differences won't be noticeable. >I would rather avoid assembly language. Also, there are >a lot of colors that I have to use, usually about 10-20 absolute colors. >Would I get faster results if I were to bypass the Palette Manager and >use lower-level tricks to get the right colors in the right rectangles? >And what about larger rectangles, up to 8x8 pixels? Use the Palette Manager-- it simplifies your programming quite a bit, and if you use PMForeColor, it is faster than SetRGBColor, because it doesn't have to do a Color2Index. Writing directly to the screen is a real pain-- you have to contend with the different bitmap formats, it isn't worth it. >Also, although this may sound kind of silly, I CANNOT figure out from >Inside Macintosh how to do something very simple - take a portion of >the image in a color window and save it to disk as a color PICT file. >A general pointer on how to do this (no pun intended) would be very >highly appreciated. OpenPicture() CopyBits(&WinPixMap,&WinPixMap, &srcrect, &srcrect, srcCopy, NULL); ClosePicture(). That's the picture-- you now merely write it out to disk according to the PICT format (in IM V and the tech notes) -- Matthew T. Russotto russotto@eng.umd.edu russotto@wam.umd.edu .sig under construction, like the rest of this campus.