Announcement

Collapse
No announcement yet.

Displaying Graphics

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Displaying Graphics

    I am trying to display a graphic (bitmap), using DDT, in the top center of the client area of a dialog box and I'm having no success. I have tried the CONTROL ADD GRAPHIC command with not-so-good results. Can someone throw a beginner a hint or two on how this is done?

    Many thanks,
    Darrell

  • #2
    There's a couple of samples in your pbwin80\samples folder. Text3d.bas or Sine.bas should do the trick.
    "There are two novels that can change a bookish fourteen-year old's life: The Lord of the Rings and Atlas Shrugged. One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs." - John Rogers

    Comment


    • #3
      In addition to GRAPHIC (depending on what you are doing) you might also look
      into CONTROL ADD IMAGE and IMAGEX.

      BMPs can be placed in a resource file (name.PBR) and easily used.
      Code:
      program.rc
      ----------
      M1 BITMAP MYBITMAP.BMP
      compile the rc file into a .res then pbr file

      Code:
      program.bas
      #compile exe
      #resource "program.pbr"
      
      FUNCTION PBMAIN() AS LONG
      .
      .
      .
       DIALOG NEW..... to hDlg
       CONTROL ADD IMAGEX,hDLG,301,"M1",0,0,100,100
      .
      .
      .
      regarding using the graphic statements, did you use graphic attach before
      using graphic bitmap load ? and perhaps a graphic redraw afterwards.

      The control add graphic itself does not load a bitmap but rather sets up the
      graphic area within a window (which can be a dialog). put your code in here
      and it will be easier to help you get it going.
      Last edited by Fred Buffington; 20 Nov 2007, 10:16 AM.
      Client Writeup for the CPA

      buffs.proboards2.com

      Links Page

      Comment


      • #4
        Russ and Fred,

        Problem solved. Thanks very much for your help. It is appreciated.

        Darrell

        Comment

        Working...
        X