SetCursor_() - Pippet in paint??
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
No, I watched the mask in the library viewer and it's correct. It should probably be 1-bit instead of 24-bit, though? But I just discovered that PB has some problems with low-images (see bug forum).netmaestro wrote:I'm a retard, it's the mask that's buggered up, and I know for sure that leaving the depth parameter off CreateImage is a mistake. Updated, could you try?
That made a white rectangle.netmaestro wrote:OK, guaranteed to fix it:Code: Select all
SetWindowColor(0, #Green)

Edit: It looks good when I change the background colour of the pipette image to black.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
[removed for relevance]
Last edited by netmaestro on Mon Nov 27, 2006 11:51 pm, edited 1 time in total.
BERESHEIT
Netmaestro, I think Trond and I have issues with our PC's. I'll be home in an hour and I can see what it looks like there.
Seeing as how my work PC and home PC are acting differently with various pieces of code, there must be a common denomenator for all of this.
edit...sorry Netmaestro...still green
Seeing as how my work PC and home PC are acting differently with various pieces of code, there must be a common denomenator for all of this.
edit...sorry Netmaestro...still green
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
It's OK now but I'd like to understand just what happened a bit better. The green background makes sense if Windows is XOR'ing the color bitmap and the transparent part of the mask. The transparent part of the mask is white and the transparent color of the bitmap was pink. White XOR'ed with pink results in green, which was showing. But then, why didn't it show on all computers instead of just a few? Is something different in newer video cards? Mine's new, and the laptop it showed green on is two years old. At any rate, with a black background for the color bitmap, white XOR'ed with black leaves nothing, so that really should be safe everywhere. If anyone understands a bit more than I do about what's going on (which doesn't take much!) I'd appreciate a tip or two.
BERESHEIT
Tranquil wrote: Unfortunately I dont have this icon on my harddisc. But you can surely extract it from Paint with some Icontools.
This code example demonstrates how to use the cursor resource from MSPaint.Exe (tested with WinNT SP6 and WinXP Pro SP2):srod wrote: The following 'icon extractor' only locates 6 icons embedded within mspaint.exe
Code: Select all
CursorID.S = "#1204"
CursorLib.S = "MSPaint.Exe"
CursorLibHandle.L = LoadLibrary_(CursorLib)
If CursorLibHandle = 0
MessageRequester("Error", CursorLib + " couldn't be loaded!", #MB_ICONERROR)
End
EndIf
CursorHandle = LoadImage_(CursorLibHandle, @CursorID, #IMAGE_CURSOR, 0, 0, #LR_DEFAULTCOLOR)
If CursorHandle = 0
MessageRequester("Error", "Cursor " + CursorID + " couldn't be loaded from " + CursorLib, #MB_ICONERROR)
End
EndIf
CreateImage(0, 100,100)
StartDrawing(ImageOutput(0))
Box(0,0,100,100,#White)
StopDrawing()
OpenWindow(0,0,0,400,300,"Pipette Demo",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
CreateGadgetList(WindowID(0))
ImageGadget(0,120,80,0,0,ImageID(0),#PB_Image_Border)
SetClassLong_(GadgetID(0), #GCL_HCURSOR, CursorHandle)
Repeat
ev=WaitWindowEvent()
Until ev=#PB_Event_CloseWindow
DestroyIcon_(CursorHandle)
End
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
netmaestro,
I used ResourceHacker (http://www.angusj.com/resourcehacker) to list all resources from MSPaint.Exe. When using resource hacker to open MSPaint.Exe you have to open the tree view node "Cursor Group" and take a look at the different cursor nodes. When opening node 1204 and clicking on 1031 you will see the pipette cursor on the right side. So you have to use #1204 to load the pipette cursor resource.
If you want some examples for simple resource handling take a look at the code of GPI:
http://www.purebasic.fr/english/viewtop ... 58&start=4
I used ResourceHacker (http://www.angusj.com/resourcehacker) to list all resources from MSPaint.Exe. When using resource hacker to open MSPaint.Exe you have to open the tree view node "Cursor Group" and take a look at the different cursor nodes. When opening node 1204 and clicking on 1031 you will see the pipette cursor on the right side. So you have to use #1204 to load the pipette cursor resource.
If you want some examples for simple resource handling take a look at the code of GPI:
http://www.purebasic.fr/english/viewtop ... 58&start=4