realbasic-nug
[Top] [All Lists]

Re: Displaying jpgs in a canvas

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Displaying jpgs in a canvas
From: Gary Edge <rb at panamind dot com>
Date: Mon, 31 Jan 2005 20:51:26 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <a2e0412d178908e46a8e71752daf93e0 at panamind dot com> <8a7f31df1e7d06f9e452b1b8ab04c542 at athenet dot net>
What kind of JPEG--is this one you dragged to your project as an internal item, or are you reading it in at runtime from a file?

And what platform are you using?

The jpegs are stored in a database and read as needed at runtime. I want them to appear at a specific location in the canvas. When a jpeg doesn't exist for the record, a pict that was dragged into the project displays correctly.

I'm running RB 5.5.4 on Mac OS 10.3.7

I did get the images to display but not correctly initially. Reading the jpeg from the database and drawing it to the canvas actually placed it off the canvas and partially in the window (a drawer window).

I found that the following code works:
dim p,np as picture

p = music.c.pictureField("picture_s").GetPicture //retrieves picture from database
np = NewPicture(p.width, p.height, screen(0).Depth)
np.Graphics.Drawpicture p, 0, 0, p.width, p.height, 0, 0, p.Width, p.Height
g.drawpicture tn,5,5

--

Best Regards,
Gary

--

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>