- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do you load a bitmap resource onto the screen during runtime? This must be simple, but I've been working at it for days.
Using the developer studio, I have uploaded bitmaps as resources, and even placed those bitmaps in dialog boxes. But I have not figured out how to display those bitmaps in a window. Right now I am getting around this problem by uploading bitmaps to the screen from a windows file (**.bmp) using the loadimage command, but the files have to accompany the compiled .exe program. I want the bitmap resource to be included in the .exe file.
THANKS FOR YOUR HELP!
Using the developer studio, I have uploaded bitmaps as resources, and even placed those bitmaps in dialog boxes. But I have not figured out how to display those bitmaps in a window. Right now I am getting around this problem by uploading bitmaps to the screen from a windows file (**.bmp) using the loadimage command, but the files have to accompany the compiled .exe program. I want the bitmap resource to be included in the .exe file.
THANKS FOR YOUR HELP!
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If it's a QuickWin application, you'll have hard time. It is easy to load the bitmap as resource (using DFWIN::LoadBitmap or DFWIN::LoadImage) but it would be tough to "push it" into a QuickWin's window. I've just tried an experiment with retrieving bits from the loaded bitmap using GetDIBits and trying to put it back with PUTIMAGE but without success -- I don't know the format of buffer returned with GETIMAGE and I don't have time to reverse-engineer it.
Windows API solution is easy. You can even "inject" an API-handled window into a QuickWin app (but you'll have to forget about using any QuickWin functions on it). I could elaborate more on the subject, but I'd like few more details from you -- particularly, what's the purpose of that window?
Jugoslav
Windows API solution is easy. You can even "inject" an API-handled window into a QuickWin app (but you'll have to forget about using any QuickWin functions on it). I could elaborate more on the subject, but I'd like few more details from you -- particularly, what's the purpose of that window?
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jugoslav:
Thanks so much for the input, I really appreciate it.
I hope that what I am trying to do is easier than I made it sound. I have loaded bitmaps as a resource, with resource names like "IDB_picture1" and now I want to display them on the screen at runtime.
I'd like to NOT have to load the bitmaps from a file on disc, but rather to have the bitmaps already compiled as part of the .exe file to make it more portable.
The window in which I want to display the bitmaps is a normal Quickwin runtime graphics window opened using the the "open" statement with file = 'user.' I have included the QWIN statements opening the window below.
Again, I really appreciate your help.
open(unit=3,file='user',title='Welcome')
wc.numxpixels = int(WindowSizeX*0.98+4)
wc.numypixels = int(WindowSizeY*0.87+3)
wc.numtextcols = -1
wc.numtextrows = -1
wc.numcolors = -1
wc.fontsize = -1
wc.title = ' 'C
if (.not.setwindowconfig(wc)) bret = setwindowconfig(wc)
fontnum=initializefonts()
iret = SETBKCOLORRGB(rgb(0,255,255))
iret = GETWSIZEQQ(3,QWIN$SIZEMAX,qw)
qw%type = qwin$set
iret = setWsizeqq(3,qw)
iret = SETBKCOLORRGB(rgb(0,255,255))
call CLEARSCREEN($GCLEARSCREEN)
Ken
Thanks so much for the input, I really appreciate it.
I hope that what I am trying to do is easier than I made it sound. I have loaded bitmaps as a resource, with resource names like "IDB_picture1" and now I want to display them on the screen at runtime.
I'd like to NOT have to load the bitmaps from a file on disc, but rather to have the bitmaps already compiled as part of the .exe file to make it more portable.
The window in which I want to display the bitmaps is a normal Quickwin runtime graphics window opened using the the "open" statement with file = 'user.' I have included the QWIN statements opening the window below.
Again, I really appreciate your help.
open(unit=3,file='user',title='Welcome')
wc.numxpixels = int(WindowSizeX*0.98+4)
wc.numypixels = int(WindowSizeY*0.87+3)
wc.numtextcols = -1
wc.numtextrows = -1
wc.numcolors = -1
wc.fontsize = -1
wc.title = ' 'C
if (.not.setwindowconfig(wc)) bret = setwindowconfig(wc)
fontnum=initializefonts()
iret = SETBKCOLORRGB(rgb(0,255,255))
iret = GETWSIZEQQ(3,QWIN$SIZEMAX,qw)
qw%type = qwin$set
iret = setWsizeqq(3,qw)
iret = SETBKCOLORRGB(rgb(0,255,255))
call CLEARSCREEN($GCLEARSCREEN)
Ken
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got that part already -- my point was that, as simple as it sounds, it's almost impossible. Rather, I was asking what else this window is supposed to be used -- just to hold the bitmap or to interact with user in some other way also? In any case, you should launch another window fully handled by API (created by CreateWindow, having window procedure, WM_PAINT handling etc.). It's not too hard but it's not trivial either. Your window title "Welcome" indicates that it's kind of a splash screen -- I could dig up an example, but let it be Monday since Friday afternoon is not the right time to start the job :-).
Another simple, although ugly & inefficient, solution could be to load the bitmap as resource, dump it to a temporary .bmp file and apply it to the window using LOADBITMAP. My XFTGDI module could be used to simplify the task (just call XCreateBitmap and XSaveBitmap).
Btw, why is a dialog wrong for the purpose?
Jugoslav
Another simple, although ugly & inefficient, solution could be to load the bitmap as resource, dump it to a temporary .bmp file and apply it to the window using LOADBITMAP. My XFTGDI module could be used to simplify the task (just call XCreateBitmap and XSaveBitmap).
Btw, why is a dialog wrong for the purpose?
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The window is used to display the results of calculations in text form (outgtext command), and also to display some graphics (I plot the results of the calculations using drawing commands like rectangle, lineto, ellipse, etc.). Multiple bitmaps are placed in proximity to the text and lines, etc., to help illustrate the concepts.
My limited experience indicates that this type of thing is not what dialog boxes are for, but correct me if I am wrong.
Anyway, thanks for your willingness to help out, glad to know at least that this is not trivial. From your comments it sounds like what I want to do can only be done with a window supporting API, and (correct me if I am wrong) this will no longer be a QWIN application, right?
I'm gone on vacation next week, but will be back on the job on Setpember 9.
Ken
My limited experience indicates that this type of thing is not what dialog boxes are for, but correct me if I am wrong.
Anyway, thanks for your willingness to help out, glad to know at least that this is not trivial. From your comments it sounds like what I want to do can only be done with a window supporting API, and (correct me if I am wrong) this will no longer be a QWIN application, right?
I'm gone on vacation next week, but will be back on the job on Setpember 9.
Ken
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page