Questions Needed Answered (neilnapier)

neilnapier

Active Member
Licensed User
Longtime User
I feel that I am unnecessarily creating many topics to ask small questions so I have decided to make this topic so that I can personally ask questions without creating a new topic each time. I feel that this is an effective method.

The first few questions i have to ask is...

1. Is their any way to get a program to read the resolution. SORTED

2. Is it possible to use writing in the forelayer (eg instead of having a curcular pen having the ability to click then type)

3. Would it be possible to get a file to be read (using the FileRead function) this statement:
B4X:
Element Nature Plant 0 255 0 0 1 1 1 0 Clear 0 File img\Plant.bmp
So that it creates a colour selectable using a image button with the picture Plant.bmp, using the pen colour as (0, 255, 0) and a couple of other things that once i know how to do them then I will undertand how to do.

4. Is there anyway to swap points that are created on the forelayer (eg a blue circle is created which then slowly falls down the forelayer)

5. To save part of the program (in my case the image inside a frame) as a bmp

6. i seem to get a fault that says
Parameter must be positive and < Width
Parameter name: x
When I click near the end of the programs edges. SORTED


That is about it... Oh!!! And the code I am using is here

Thanks for any questions that can be answered.
 
Last edited:

dzt

Active Member
Licensed User
I feel that I am unnecessarily creating many topics to ask small questions so I have decided to make this topic so that I can personally ask questions without creating a new topic each time. I feel that this is an effective method.

I disagree. It is more useful to another user a topic with a specific subject.

Here is a workaround for the first question. Except the attached .sbp file is needed the dzHW.DLL (PPC) and dzHWdekstop.DLL (PC) from here http://www.b4x.com/forum/showthread.php?t=384. Page 2 post #15 (latest version)
 

Attachments

  • test09_Resolution.sbp
    1.2 KB · Views: 287
Last edited:

neilnapier

Active Member
Licensed User
Longtime User
I could use that with my program so thanks... but why is there 4 resolution sizes on it... resolutions only have 2... eg 400*500.

It seems that the last two are the ones for desktop... is it the same with PPC?

EDIT: I used
B4X:
Dim hWnd 
   hWnd    = dzhw.GetActiveWindowHandle
   rect() = dzhw.GetWindowRect(hWnd)
   Resolution.Text (   "Resolution: " & rect.Right &    " x " & rect.Bottom,)

It doesn't seem to work but I can't find anything wrong with it.

EDIT2: I have realised that it works with a msgBox but I need it to appear in a label... is there any way to do this?

EDIT3: SORTED IT MYSELF!!!!! Can anyone help with any of the other questions

EDIT4: sorted another.
 
Last edited:

dzt

Active Member
Licensed User
Hi,

neilnapier said:
I could use that with my program so thanks... but why is there 4 resolution sizes on it... resolutions only have 2... eg 400*500.

Actually Left, Top, Right and Bottom are points relative to screen.

Width = rect.Right-rect.Left
Height = rect.Bottom-rect.Top

B4X:
Resolution.Text = "Resolution: " & rect.Right-rect.Left & " x " & rect.Bottom-rect.Top
 
Top