Welcome, Guest |
You have to register before you can post on our site.
|
Latest Threads |
Curious if I am thinking ...
Forum: Help Me!
Last Post: grymmjack
18 minutes ago
» Replies: 29
» Views: 420
|
Trojan infection !
Forum: Help Me!
Last Post: PhilOfPerth
4 hours ago
» Replies: 4
» Views: 90
|
Qix line monster
Forum: Programs
Last Post: Abazek
6 hours ago
» Replies: 0
» Views: 25
|
Tenary operator in QB64 w...
Forum: Utilities
Last Post: eoredson
8 hours ago
» Replies: 8
» Views: 307
|
_IIF limits two question...
Forum: General Discussion
Last Post: NakedApe
Today, 01:19 AM
» Replies: 10
» Views: 435
|
Aloha from Maui guys.
Forum: General Discussion
Last Post: SMcNeill
Yesterday, 10:38 PM
» Replies: 17
» Views: 495
|
Glow Bug
Forum: Programs
Last Post: SierraKen
Yesterday, 06:33 PM
» Replies: 7
» Views: 135
|
ADPCM compression
Forum: Petr
Last Post: Petr
Yesterday, 03:13 PM
» Replies: 0
» Views: 44
|
Who wants to PLAY?
Forum: QBJS, BAM, and Other BASICs
Last Post: dbox
Yesterday, 02:47 PM
» Replies: 15
» Views: 247
|
BAM Sample Programs
Forum: QBJS, BAM, and Other BASICs
Last Post: CharlieJV
Yesterday, 02:50 AM
» Replies: 36
» Views: 2,004
|
|
|
A list of forums at or near the Portal |
Posted by: PhilOfPerth - 05-07-2022, 01:23 AM - Forum: General Discussion
- No Replies
|
|
I, for one, have trouble re-locating threads I've visited or subscribed to, and I reckon it would be useful to have a list of the major forums (fora?) at the Portal - after all, a portal is supposed to be the main entry-point to a location.
|
|
|
Can I restrict attempted resizing of a screen to an invalid side? |
Posted by: hanness - 05-06-2022, 11:19 PM - Forum: General Discussion
- Replies (3)
|
|
Apologies for so many questions. Unfortunately, there are just some things I cannot seem to figure out on my own :-)
Let's assume a create a screen like this:
Code: (Select All) oldimage& = handle&
handle& = _NewImage(Horizontal, Vertical, 256)
Screen handle&
_FullScreen _Off
_FreeImage oldimage&
I allow the user to resize the screen, but I want to restrict them from making the windows smaller than 400 x 400. That part I can do. I simply check the width and height after resizing the screen and if either width or height is less than 400 I change it to 400.
My concern is that while the user is dragging a corner of the screen to resize it, they can drag it to a point where it causes my program to crash while they are still dragging the corner but before I can check it and resize it. See the screenshot below for an example.
Put another way, I can check the size of the screen AFTER they have resized it, but I can't prevent them from dragging the corners to a ridiculously small size that causes a crash. Is there any way to prevent this?
Image1.bmp (Size: 172.96 KB / Downloads: 112)
|
|
|
Slight problem with calculation of number of lines of text that can be displayed |
Posted by: hanness - 05-06-2022, 10:06 PM - Forum: General Discussion
- Replies (2)
|
|
I'm so close to having everything working - just a few tiny odds and ends to figure out....
Let's say I open a Windows a screen with QB64 that is 400 x 400 pixels and I start displaying text on the screen with a font size of 12. My calculations say that I should be able to fit 33 lines of text on this screen (33 x 12 pixels = 396 pixels). However, in actuality, I can only fit 32 lines.
Is there something like an invisible "buffer" of a few pixels that cannot be used?
When I use a screen capture utility to capture a copy of my window, I can see that the area inside of the physical screen borders is precisely 400 pixels so I can't quite make sense of what I'm running into.
|
|
|
Boolean Algebra |
Posted by: TarotRedhand - 05-06-2022, 11:44 AM - Forum: Learning Resources and Archives
- Replies (11)
|
|
Some years ago I wrote a tutorial on this topic for the scripting community of Neverwinter Nights. I have now gone through this and edited it to make it relevant for QB64. As I am new to QB64, I would appreciate it if someone will download it, read it and let me know of any errors that they come across no matter how small. The package contains 2 pdf documents (the readme and the 20 page tutorial), an HTML cheat sheet and a plain text document of pre-calculated constants.
Dropbox Link removed - Download link to newer, more accurate version on page 2 of this thread.
All comments welcome.
Thanks.
TR
|
|
|
image unroller |
Posted by: James D Jarvis - 05-05-2022, 09:26 PM - Forum: Programs
- Replies (3)
|
|
A simple little image unroller that does an image reveal like a scroll being unrolled. Someone posted an example in a facebook group in their dialect of basic asking if other forms of basic could handle it. So I whipped this up.
Code: (Select All) ' Picture unroller
img& = _LoadImage("hexmap0001.jpg", 32) 'your image here
w = _Width(img&)
h = _Height(img&)
sc& = _NewImage(w, h, 32)
Screen sc&
Cls: s = 3
For yc = 0 To h Step s:
_Limit 30
_PutImage (0, 0), img&, sc&, (0, 0)-(w, yc)
_PutImage (0, yc - 6)-(w, yc + 6), img&, sc&, (0, yc)-(w, yc + 3)
Next yc
|
|
|
How can I read characters from the screen? |
Posted by: hanness - 05-05-2022, 09:16 PM - Forum: General Discussion
- Replies (4)
|
|
Assume that I am initializing my display like this:
_FullScreen _Off , _Smooth
_FreeImage oldimage&
Font& = _LoadFont(FontPath$, FontSize, "MONOSPACE")
_Font Font&
Now I write a bunch of text to the screen.
Later, I want to read the character at the upper left of the screen. I tried to do this like this:
print screen(1,1)
or
MyVar$ = CHR$(screen(1,1))
However, I'm getting an illegal function call when the line with screen(1,1) is executed.
Is this only valid with screen mode 0 or am I missing something here?
If this cannot be made to work, is there any other way to read characters from the screen?
|
|
|
|