DgsGridListRemoveItemImage: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client function}} This function remove the image from the grid list item. ==Syntax== <syntaxhighlight lang="lua"> bool dgsGridListRemoveItemImage( element gridList, int r...")
 
No edit summary
 
Line 31: Line 31:
end
end
setTimer(function()
setTimer(function()
DGS:dgsGridListRemoveItemImage(gridlist,row,1) --Remove after 1 sec
DGS:dgsGridListRemoveItemImage(gridlist,1,1) --Remove after 1 sec
end,1000,1)
end,1000,1)
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 10:38, 5 August 2023

This function remove the image from the grid list item.

Syntax

bool dgsGridListRemoveItemImage( element gridList, int rowIndex, int columnIndex )

Required Arguments

  • gridList: the grid list containing the item you're interested in.
  • rowIndex: An integer of the row index of the item.
  • columnIndex: An integer of the column index of the item.

Returns

Returns true if set successfully, false if one of the arguments was invalid.

Example

DGS = exports.dgs
texture = dxCreateTexture("image.png") -- put your texture element here

gridlist = DGS:dgsCreateGridList(300,200,300,400,false)
DGS:dgsSetProperty(gridlist,"rowHeight",30) -- make it thicker to see the image clearer
DGS:dgsGridListAddColumn(gridlist,"Country",0.2)
DGS:dgsGridListAddColumn(gridlist,"ID",0.7)
for i=1,10 do
	local row = DGS:dgsGridListAddRow(gridlist)
	DGS:dgsGridListSetItemText(gridlist,row,2,tostring(i))
	DGS:dgsGridListSetItemImage(gridlist,row,1,texture,tocolor(255,255,255,255),10,5,25,20)
end
setTimer(function()
	DGS:dgsGridListRemoveItemImage(gridlist,1,1) --Remove after 1 sec
end,1000,1)

See Also

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips