Jump to content

create graphic over picture used as background


phil11
 Share

Recommended Posts

Hello,

i tried to create some graphics over a picture set as background

set the GuiCtrlSetState(-1,$GUI_DISABLE) for the pic

so that allows to put some controlls visible on the pic,

but the graphics still stay invisible :D

any idea how to do this ?

thank you

Link to comment
Share on other sites

Hello,

i tried to create some graphics over a picture set as background

set the GuiCtrlSetState(-1,$GUI_DISABLE) for the pic

so that allows to put some controlls visible on the pic,

but the graphics still stay invisible :D

any idea how to do this ?

thank you

Post a short reproducer script to show the symptoms. Needn't be more than about 20 lines, I would think. It will give potential help something to look at.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Post a short reproducer script to show the symptoms. Needn't be more than about 20 lines, I would think. It will give potential help something to look at.

:D

$c1=GUICreate("child 1", 355, 256, 81, 66,$WS_POPUPWINDOW)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($c1), "hwnd", WinGetHandle($LoDOv))
GUISetBkColor(0x000000)
Global $Pic2 = GUICtrlCreatePic(".\images\mypic.jpg", 0, 0, 340, 240, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GuiCtrlSetState(-1,$GUI_DISABLE)
GUISetState(@SW_SHOW)

$graph = GuiCtrlCreateGraphic(350, 250, 1,1)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xffff00)                       
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, -350,-305,360,360)
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, -290,-245,240,240)
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, -230,-185,120,120)
GUICtrlSetState(-1, $GUI_GR_REFRESH)
GUISetState(@SW_SHOW)
Link to comment
Share on other sites

  • 2 weeks later...

Hello phil11! Did you solve this issue? Because I have exactly the same problem.

I want to draw something above Pic object. I see filling the Graphic object, but it disappears right after end of GUICtrlSetGraphic operation and I see only the Pic object containing the image.

Link to comment
Share on other sites

OK, it looks we need to help ourselves. At first, you have to remove the first GUISetState(@SW_SHOW) call from your script. I found that if you call it two times like in your example, the newly drawn graphics is just not correctly refreshed after its creation. If you overlap the gui window with another window (or just drag it outside the visible screen), the circles will be displayed. However, still under the image. Remove the first call of GUISetState and the circles will be drawn right away.

Here is my test sample:

#include <GUIConstants.au3>

$c1=GUICreate("graphics over image test", 320, 240, 0, 0,$WS_SIZEBOX+$WS_SYSMENU)
GUISetBkColor(0x000000)
$n=GUICtrlCreatePic(@WindowsDir & "\Soap Bubbles.bmp",80,55, 160,120)
GuiCtrlSetState(-1,$GUI_DISABLE)

$graph = GuiCtrlCreateGraphic(350, 250, 1,1)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xffff00)                       
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, -350,-305,360,360)
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, -290,-245,240,240)
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, -230,-185,120,120)
GUICtrlSetState(-1, $GUI_GR_REFRESH)
GUISetState(@SW_SHOW)

While 1
 $msg = GUIGetMsg()
 If $msg = $GUI_EVENT_CLOSE Then ExitLoop
 Sleep(20)
WEnd

Can anyone knowledgeable please look at this sample and tell us if it's OK or if there is something wrong with script (or a bug in Autoit)?

Link to comment
Share on other sites

Thanks for link ResNullius,

i don't know if you got same error ? :

TobiasGraphicFunctions.au3 (554) : ==> Can not redeclare a constant

Const $tagGDIPIMAGECODECINFO = "byte CLSID[16];byte FormatID[16];ptr CodecName;ptr DllName;ptr FormatDesc;ptr FileExt;ptr MimeType;dword Flags;dword Version;dword SigCount;dword SigSize;ptr SigPattern;ptr SigMask"

Const ^ ERROR

hope we'll find some way ...

thank you

Link to comment
Share on other sites

Thanks for link ResNullius,

i don't know if you got same error ? :

hope we'll find some way ...

thank you

If the constant is declared in the script, either an include for those functions (the UDF) then just comment out the lines. DO NOT do it to AutoIt include files.
Link to comment
Share on other sites

Hi odklizec,

no, i couldn't

i asked for more over here Graphic over Gif

till now ... no answer

only thing i know ... picture stays over graphic ....

but at the opposite, ... to "delete" (refresh) graphic, i used black pic

if possible, still looking for

thanks

Hi Phil11,

Sorry, I abandonned that thread since the other guys went totally OT.

could you put some code or explain what you mean with "box" ..

is this a child window ? or .. ?

The 'box' is simply a coloured box within the gif. Nothing to do with any AUTOIT functions.

Have a look at the gif with the grey box in the first post of the other thread....the grey is litterally part of the image.

I haven't discovered a fix for this yet problem (yet) :)

- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...