Message-ID: <44D2A5B4.9020407 at rftp.com> Date: Thu, 03 Aug 2006 18:41:08 -0700 From: Robert Roessler Organization: Robert's High-performance Software MIME-Version: 1.0 To: lablgtk at math.nagoya-u.ac.jp Subject: Re: Rendering an image on a canvas? References: <44D2455B.6000200 at gushee.net> <44D24DF8.30601 at gushee.net> <44D269FE.3030902 at gushee.net> <44D26FFB.9090109 at rftp.com> <44D2765B.9060000 at gushee.net> In-Reply-To: <44D2765B.9060000 at gushee.net> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Length: 1994 Matt Gushee wrote: > Robert Roessler wrote: >> Matt Gushee wrote: >>> Never mind, I figured it out. >> >> Hey, just because no one stepped up with the answer for you, doesn't >> mean that no one else is *interested* in the answer... ;) > > Oh, all right. I guess I got annoyed because a) I dislike GTK in the > first place, and b) this is not the first time I've had trouble getting > a response from this list. I didn't wait very long today, but I did last > time. Anyway ... I don't know if this is *the* way to do it, but it's a > way: > > let pb0 = GdkPixbuf.from_file bgfile > and pb = GdkPixbuf.create ~width:width ~height:height () in > GdkPixbuf.scale ~dest:pb ~dest_x:0 ~dest_y:0 ~scale_x:width' > ~scale_y:1. pb0; > (* Yes, ~scale_y:1. is necessary. I would guess that if you omit > this argument, the image is scaled by the same amount in both > directions--at any rate, it didn't come out right. *) > let w = GWindow.window ~width:width ~height:height () in > let c = GnoCanvas.canvas ~packing:w#add () in > let root_group = c#root in > let bg = GnoCanvas.pixbuf ~pixbuf:pb ~props:[`ANCHOR `NW] root_group Thanks for posting your solution, Matt. As for the relative "quietness" of this list, my take is that there are number of factors: 1) as Erik says, the intersection of OCaml programmers and GTK programmers does not seem to be large 2) of that set, the number who are especially knowledgeable in both *and* LablGTK is a smaller number still 3) the LablGTK experts surviving this winnowing process tend to be busy elsewhere, be interested in more academic/theoretical [vs "engineering"] problems, or both ;) This scarcity is unfortunate, since combining the coolness and fairly wide applicability of OCaml with GTK in all its "baroqueness" (not necessarily to be confused with "brokenness"), LablGTK has the makings of a viable cross-platform GUI toolkit... Robert Roessler robertr@rftp.com http://www.rftp.com