You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
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?
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
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.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment