Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #141 > unrolled thread

Plotting Jpegs in Toolbox Window

Started byMister Ron <mrronman@googlemail.com>
First post2011-04-02 14:33 -0700
Last post2011-05-01 15:25 -0700
Articles 9 — 6 participants

Back to article view | Back to comp.sys.acorn.programmer


Contents

  Plotting Jpegs in Toolbox Window Mister Ron <mrronman@googlemail.com> - 2011-04-02 14:33 -0700
    Re: Plotting Jpegs in Toolbox Window Michael Gerbracht <nospam@cityweb.de> - 2011-04-03 12:50 +0100
      Re: Plotting Jpegs in Toolbox Window Gavin Wraith <gavin@wra1th.plus.com> - 2011-04-03 15:12 +0100
        Re: Plotting Jpegs in Toolbox Window Christopher Bazley <cs99cjb@gmail.com> - 2011-04-13 14:41 -0700
    Re: Plotting Jpegs in Toolbox Window Mister Ron <mrronman@googlemail.com> - 2011-04-18 12:07 -0700
      Re: Plotting Jpegs in Toolbox Window Mister Ron <mrronman@googlemail.com> - 2011-04-18 13:21 -0700
        Re: Plotting Jpegs in Toolbox Window Martin Wuerthner <spamtrap@mw-software.com> - 2011-05-01 11:21 +0200
          Re: Plotting Jpegs in Toolbox Window Mister Ron <mrronman@googlemail.com> - 2011-05-01 05:06 -0700
    Re: Plotting Jpegs in Toolbox Window Gerph <gerph@gerph.org> - 2011-05-01 15:25 -0700

#141 — Plotting Jpegs in Toolbox Window

FromMister Ron <mrronman@googlemail.com>
Date2011-04-02 14:33 -0700
SubjectPlotting Jpegs in Toolbox Window
Message-ID<c9e41319-1e35-4e86-afb6-26b46e4a1852@u12g2000vbf.googlegroups.com>
Hi
has anyone got a guide to plotting jpegs into a toolbox window.
I can plot to the screen ok but don't know how to get the toolbox will
redraw the jpeg when the window is covered over.

Mr Ron

[toc] | [next] | [standalone]


#142

FromMichael Gerbracht <nospam@cityweb.de>
Date2011-04-03 12:50 +0100
Message-ID<51be1e7d34nospam@cityweb.de>
In reply to#141
Mister Ron <mrronman@googlemail.com> wrote:
> has anyone got a guide to plotting jpegs into a toolbox window.
> I can plot to the screen ok but don't know how to get the toolbox will
> redraw the jpeg when the window is covered over.

In ResED you can define that a window requires help of the application to
redraw it (Other Properties -> untick Auto-redraw).
If you have done this RISC OS will generate a toolbox event when part of the
window has been hidden and needs to be redrawn now. Basically RISC OS will
give you the coordinates of a number of rectangles you need to redraw.

You can also put the jpeg into a draw file and render it instead - this might
be easier.

You can probably find an example application in Basic which shows a draw
file. I can remember that I had it somewhere but can't find it at the moment.
Hopefully someone here can point you to it.

Michael

-- 
Please replace nospam by m.gerbracht when replying by e-mail

[toc] | [prev] | [next] | [standalone]


#143

FromGavin Wraith <gavin@wra1th.plus.com>
Date2011-04-03 15:12 +0100
Message-ID<08902bbe51.wra1th@wra1th.plus.com>
In reply to#142
In message <51be1e7d34nospam@cityweb.de>
          Michael Gerbracht <nospam@cityweb.de> wrote:

> You can also put the jpeg into a draw file and render it instead - this might
> be easier.
>
> You can probably find an example application in Basic which shows a draw
> file. I can remember that I had it somewhere but can't find it at the moment.
> Hopefully someone here can point you to it.

See !AppBasic.Resources.Examples.!Drawing
-- 
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/

[toc] | [prev] | [next] | [standalone]


#190

FromChristopher Bazley <cs99cjb@gmail.com>
Date2011-04-13 14:41 -0700
Message-ID<1f3381ff-fefd-40ca-a0bb-6dbedd05981f@j35g2000prb.googlegroups.com>
In reply to#143
When you have your redraw loop working, please remember to test it in
screen modes with a variety of eigen values (0,1 and 2) and colour
depths. It's very annoying (and surprisingly common) to find programs
that don't work properly except in whatever screen mode the author
happens to habitually use. In the olden days this was typically a mode
with EX1 EY2; nowadays it's more likely to be EX1 EY1.

--
Christopher Bazley

[toc] | [prev] | [next] | [standalone]


#196

FromMister Ron <mrronman@googlemail.com>
Date2011-04-18 12:07 -0700
Message-ID<511236f7-b33b-4cf8-a6ee-7769dc40f76f@k3g2000prl.googlegroups.com>
In reply to#141
Thanks for the replies, I'm starting to get something together now.

Mister Ron

[toc] | [prev] | [next] | [standalone]


#197

FromMister Ron <mrronman@googlemail.com>
Date2011-04-18 13:21 -0700
Message-ID<cf86d1a8-0804-4489-ae48-5edfda66af49@q40g2000prh.googlegroups.com>
In reply to#196
On Apr 18, 8:07 pm, Mister Ron <mrron...@googlemail.com> wrote:
> Thanks for the replies, I'm starting to get something together now.
>
> Mister Ron

Erm, no I'm not.
How do you calculate the point to plot at into a window please.

Thanks

[toc] | [prev] | [next] | [standalone]


#264

FromMartin Wuerthner <spamtrap@mw-software.com>
Date2011-05-01 11:21 +0200
Message-ID<b2427ccc51.martin@bach.planiverse.com>
In reply to#197
In message <cf86d1a8-0804-4489-ae48-5edfda66af49@q40g2000prh.googlegro 
ups.com>
          Mister Ron <mrronman@googlemail.com> wrote:

> On Apr 18, 8:07 pm, Mister Ron <mrron...@googlemail.com> wrote:
>> Thanks for the replies, I'm starting to get something together now.
>>
>> Mister Ron

> Erm, no I'm not.
> How do you calculate the point to plot at into a window please.

Have you looked at the PRM? It explains how the coordinates are 
calculated. Pages 3-12 to 3-14. You need to convert the window 
coordinates of the object you want to plot into screen coordinates 
based on the information returned to you from 
RedrawWindow/GetRectangle.

-- 
Martin
---------------------------------------------------------------------
Martin Wuerthner         MW Software      http://www.mw-software.com/
        RISC OS Software for Design, Printing and Publishing
---------------------------------------------------------------------

[toc] | [prev] | [next] | [standalone]


#265

FromMister Ron <mrronman@googlemail.com>
Date2011-05-01 05:06 -0700
Message-ID<c026ca6d-e144-4246-9aee-2f8bad0d3269@26g2000yqa.googlegroups.com>
In reply to#264
On May 1, 10:21 am, Martin Wuerthner <spamt...@mw-software.com> wrote:
> In message <cf86d1a8-0804-4489-ae48-5edfda66a...@q40g2000prh.googlegro
> ups.com>
>           Mister Ron <mrron...@googlemail.com> wrote:

> Have you looked at the PRM? It explains how the coordinates are
> calculated. Pages 3-12 to 3-14.

Thanks. I have and it seems to work fine now.
Thankyou

[toc] | [prev] | [next] | [standalone]


#266

FromGerph <gerph@gerph.org>
Date2011-05-01 15:25 -0700
Message-ID<c16dd915-1a3a-4031-9f03-a398984ef08d@h38g2000yqn.googlegroups.com>
In reply to#141
On Apr 2, 10:33 pm, Mister Ron <mrron...@googlemail.com> wrote:
> Hi
> has anyone got a guide to plotting jpegs into a toolbox window.
> I can plot to the screen ok but don't know how to get the toolbox will
> redraw the jpeg when the window is covered over.

Some ancient code I have lying around in a test application...

/*************************************************** Gerph *********
 Function:     load_display
 Description:  Load the display image
 Parameters:   none
 Returns:      none
 ******************************************************************/
void load_display(void)
{
  dprintf("load_display: file = %s\n",display.filename ?
                                      display.filename : "<none>");
  display.image = image_getimage(display.filename);
  display.index = 0;
  dprintf("load_display: image = %p\n",display.image);
  if (display.image == NULL)
  {
    error_trap(imagefilegadget_set_value(0, main_window,
Gadget_ImageFile, -1, NULL, 0), 0);
  }
  else
  {
    error_trap(imagefilegadget_set_value(0, main_window,
Gadget_ImageFile, display.image->filetype,
 
display.image->data,
 
display.image->length), 0);
  }
}

Uh, and that's pretty much it. Create an ImageFileGadget with the
required size and location in the window, and gadget id
Gadget_ImageFile.

oh, image_getimage is just a function that loads from disc and sticks
the data in a buffer with the filetype and length; nothing at all
complex.

--
Gerph.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.acorn.programmer


csiph-web